Jump to content
Sign in to follow this  
galzohar

Clean up script?

Recommended Posts

_toDelete = nearestObjects [markerPos "mrkObj1", ["WeaponHolderSimulated", "GroundWeaponHolder", "Default"], deleteRadius];
_toDelete = _toDelete + ((markerPos "mrkObj1") nearObjects ["Default", deleteRadius]); // fix for bug with detecting satchels
for "_i" from 0 to ((count _toDelete) - 1) do
{
deleteVehicle (_toDelete select _i);
};

This is what I have so far. However, it seems sometimes weapons stay on the ground regardless. Any other classes I need to search for and delete to get a proper cleanup?

Note: Dead bodies are cleaned up elsewhere, so this is just for other left-over stuff (such as the weapons that sometimes stay on the ground).

Edited by galzohar

Share this post


Link to post
Share on other sites

Actually, it's not weaponHolder its GroundWeaponHolder, that is why it doesn't work.

If you use Reammobox or Reammobox_F as Loyal suggested that will work as well but it also deletes Ammoboxes them selves.

Share this post


Link to post
Share on other sites

Well, the current script seems to delete everything I manually drop during testing.

However, when picking up weapons from a dead body, the old weapon and magazines drop automatically to the ground, and seem to not be deleted by the above script, even when the class is changed to GroundWeaponHolder.

EDIT: Seems like the class for those weapon holders was indeed "WeaponHolderSimulated" (which is actually the string returned by typeOf, so it's the actual class of those objects, not a superclass of theirs).

First post updated with (so far) working script.

Edited by galzohar

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
Sign in to follow this  

×