Jump to content
S3LMON

How can I delete objects in scope?

Recommended Posts

Hello 🙂

 

I only know the location information and I want to delete all objects (except buildings) within a certain range (300m) from that location.

I started with Array and tried a lot of things, but I couldn't even put objects in scope (except buildings) into an array.

(It is no problem to delete all objects except the building.)

Is there anyone who can provide me with a solution?

 

I have poor scripting skills so I am not sure how to achieve my goal. I am not an English speaking person.

I am not sure if my intent has been clearly communicated. (Using Google Translate)

 

thanks!

 

 

 

Share this post


Link to post
Share on other sites

Hey S3LMON. I am not sure I understand what exactly scope means in the context of your question, but I will assume that you mean "area". You could possibly try to run a script like the following

/* I will use the position of the player here and a distance of
 * 500 metres from the player to delete everything but the buildings
 */

// Get all objects in a sphere with radius 500 and centre the player
private _allObjs = (getPos player) nearObjects 500;

// Get the buildings in the same sphere
private _allBlds = (getPos player) nearObjects ["House", 500];

// Subtract the buildings from all the objects
_allObjs = _allObjs - _allBlds;

// Delete the objects
_allObjs apply {deleteVehicle _x;};

Please keep in mind that the above code snippet is not tested and should be treated with caution. One more thing to note is that with the command deleteVehicle you can only delete objects inserted in the mission editor and during the game's progress.

 

I hope this helps somehow, but please don't hesitate to ask for more help if this is not a solution to your problem or a new issue arises.

Share this post


Link to post
Share on other sites

You can also use the Hide Terrain Objects module. :icon_biggrin:

  • Like 2

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

×