BigRed 2 Posted June 28, 2009 This is the script I used in OFP but doesn't work in ArmA 2 can someone help me out? This is in the init file: []exec "Clearcorpse.sqs" then the Clearcorpse: ?(!local server):exit_n=-1 #loop ?(count (list EVERYUNIT) < 2):goto "loop" _curlist = list EVERYUNIT #loop2 _n = _n + 1 ?(!alive (_curlist select _n)): [(_curlist select _n)] exec "common\delbody.sqs" ?(_n < (count _curlist)):goto "loop2" _n=0 ?(MISSIONSTOP):exit goto "loop" exit the delbody: ; Select the Unit_unit = _this select 0 ;-Delay the delete after death ~15 ; delete the unit deletevehicle _unit exit Share this post Link to post Share on other sites
Rommel 2 Posted June 28, 2009 You may be better off with something more... simple (could there be :p). Execution: _xhandle = execvm "clearCorpses.sqf" clearCorpses.sqf private ["_aU", "_dU"]; _aU = allUnits; while {true} do { sleep 60; if (count _aU != count allUnits) then { _dU = _aU - allUnits; {hidebody _x} foreach _dU; }; _aU = allUnits; }; SQF all the way mate. Share this post Link to post Share on other sites
BigRed 2 Posted June 28, 2009 I will give it a go thanks Rommel;) Share this post Link to post Share on other sites
Junker 0 Posted June 29, 2009 i thought garbage removal module did this.. ? Share this post Link to post Share on other sites
Rommel 2 Posted June 29, 2009 No, it cleans up memory problems with certain modules AFAIK. Share this post Link to post Share on other sites
-DirTyDeeDs--Ziggy- 0 Posted June 29, 2009 Execution: _xhandle = execvm "clearCorpses.sqf" pardon my ignorance, but does this line go in the init :rolleyes: thanks Share this post Link to post Share on other sites
Rommel 2 Posted June 29, 2009 It can go anywhere you want it too, but yes the init.sqf should hold it fine. :) Share this post Link to post Share on other sites
Benny. 15 Posted June 29, 2009 (edited) You can sweep it with Garbage Collector, it will remove a desired (dead) object when the player (or a group member) is further than 500 meters. It Also sweep empty groups. Use it like that (NOTE: don't use it server side!): //--- Delete body (Garbage Collector) [_unit] call BIS_GC_trashItFunc; GC: scriptName "garbage_collector\data\scripts\process_queue.sqf"; /* File: process_queue.sqf Related: garbagecollector.fsm Author: Joris-Jan van 't Land Description: Process the garbage queue for the Garbage Collector FSM. */ //TODO: dangerous and does not work on dedicated server. Allow registering important units to the GC through a function? private ["_mainGrp", "_queue"]; _mainGrp = group player; _queue = BIS_GC getVariable "queue"; for "_i" from 0 to ((count _queue) - 1) do { private ["_entry", "_time"]; _entry = _queue select _i; _time = _entry select 1; //Check the object was in the queue for at least the assigned time (expiry date). if (_time <= time) then { private ["_object"]; _object = _entry select 0; switch (typeName _object) do { case (typeName objNull): { //Player and his squadmates cannot be too close. //ToDo: use 'cameraOn' as well? if (({(_x distance _object) <= 500} count (units _mainGrp)) == 0) then { deleteVehicle _object; _queue set [_i, -1]; }; }; case (typeName grpNull): { //Make sure the group is empty. if (({alive _x} count (units _object)) == 0) then { deleteGroup _object; _queue set [_i, -1]; }; }; default {}; }; }; }; _queue = _queue - [-1]; BIS_GC setVariable ["queue", _queue]; true Edited June 29, 2009 by Benny. Share this post Link to post Share on other sites
BigRed 2 Posted June 29, 2009 It worked thanks Rommel and Ziggy, I did put it in the init and it works like a champ! Share this post Link to post Share on other sites
Ghost 40 Posted July 5, 2009 (edited) You may be better off with something more... simple (could there be :p).Execution: _xhandle = execvm "clearCorpses.sqf" clearCorpses.sqf private ["_aU", "_dU"]; _aU = allUnits; while {true} do { sleep 60; if (count _aU != count allUnits) then { _dU = _aU - allUnits; {hidebody _x} foreach _dU; }; _aU = allUnits; }; SQF all the way mate. **update tried with a spawning unit script and seems to work very nicely, thank you** Edited July 5, 2009 by Ghost Share this post Link to post Share on other sites
kevbaz 0 Posted July 12, 2009 i cant seem to be able to get it to work, could you explain the condidtions to me? ie sleep 60? is that 60 seconds? minutes? units? i have a small 8 player dm which builds up bodies quick and would appreiate a way of removing them :D cheers Share this post Link to post Share on other sites
Heatseeker 0 Posted July 12, 2009 (edited) The loop removes burries all dead every 60 seconds. Edited July 12, 2009 by Heatseeker Share this post Link to post Share on other sites
kevbaz 0 Posted July 12, 2009 hmm ok, didnt seem to work for me, i even tried setting it to 10, ill try again in the morning.. well when i get up as its 2:20am ... hehe cheers Share this post Link to post Share on other sites
Gaffa 0 Posted July 24, 2009 Hi, This script works great so far. However, would it be possible to add some code which deletes vehicles as well? Share this post Link to post Share on other sites
Ins@ne 10 Posted August 26, 2009 Hi ,i second what Gaffa said about adding a line for vehicles. Ive tried the examples in Mr Murrays Guide ,with and without ,niether worked for me. So i ended up using Rommels which worked like a treat. But it would be even better if it got rid of vehicles. Any one else who has managed to over come this could u plz help. Share this post Link to post Share on other sites
Uncle Imshi 10 Posted October 6, 2009 If this script only buries bodies, is it actually reducing the burden on the server? Also in testing on a dedi server I've noted that it causes some bodies to linger behind and bounce in mid air. Share this post Link to post Share on other sites
ProfTournesol 956 Posted October 6, 2009 If this script only buries bodies, is it actually reducing the burden on the server?Also in testing on a dedi server I've noted that it causes some bodies to linger behind and bounce in mid air. Burying body = deleting bodies. They are first buried, then deleted. Share this post Link to post Share on other sites
Uncle Imshi 10 Posted October 6, 2009 Cool. Anyone else experienced or solved the bouncy bodies bug? Share this post Link to post Share on other sites
Binesi 10 Posted October 8, 2009 Cool.Anyone else experienced or solved the bouncy bodies bug? Ya, hideBody isn't reliable. Add a small sleep and then a deleteVehicle in case it doesn't work. Share this post Link to post Share on other sites
Rommel 2 Posted October 8, 2009 Having never seen this bouncy bodies problem. However as suggested, a simple deletevehicle after a few seconds should be suffice. Share this post Link to post Share on other sites
DrStrangeLove_EBDA 10 Posted October 21, 2009 (edited) Tried the hidebody script. Is this supposed to be for player bodies, AI units or both? The one time it worked, it only half buried the AI units and never deleted them... Edited October 23, 2009 by DrStrangeLove_EBDA Share this post Link to post Share on other sites