Sign in to follow this  
Ninja2dan

[SOLVED] Looking for "remove item" script

5 posts in this topic

I'm needing some kind of script or code that I can use to remove objects on the map at server load, such as curbs. I have been trying some code that works great in the editor, but fails to work on the live server.

For example, I can place the code below into the init of a battery, flagging the battery as s simple object and to not show the model. It then removes all curbs, bushes, trees, trash cans, or other objects (not buildings) within the radius called by the code.

Quote

{ hideObjectGlobal _x } forEach (( nearestObjects [ getPos this , [], 10 ]) - (( getPos this ) nearObjects 10 ));

When I preview the map in the editor with the batteries and init code in the mission.sqm, it works. The curbs are gone, without any "ghost" object to bump into. It's vital that this works due to my trader layout, but when I add those items and code into the mission.sqm for the server, those items are not removed.

I've already talked with a few very talented scripters, and so far they have not been able to provide a working solution. I have seen a few other servers that have curbs or other items removed on their maps, so I know it's possible. But so far nobody has been willing to share how to do it. I'm left with posting on the forums here and asking if anyone else either knows of an existing method that actually works, or is willing to create something that works. I'm on a fixed income, but I'm willing to compensate someone if necessary if they can make this happen.

Edited by Ninja2dan
solution provided

Share this post


Link to post
Share on other sites

this is what i use

Spoiler

/**
 * Remove/Hide Map Objects From Terrain
 */

_markerarray = ["RemoveMapObjects1","RemoveMapObjects2","RemoveMapObjects3"];

_location=[26726.8,24589.5,0];    
_radius=15;   
_terrainobjects=nearestTerrainObjects [_location,[],_radius]; {hideObjectGlobal _x} foreach _terrainobjects;

_location=[26808.3,24674.5,0];    
_radius=8;   
_terrainobjects=nearestTerrainObjects [_location,[],_radius]; {hideObjectGlobal _x} foreach _terrainobjects;

_location=[26762.8,24623.6,0];    
_radius=8;   
_terrainobjects=nearestTerrainObjects [_location,[],_radius]; {hideObjectGlobal _x} foreach _terrainobjects;

so just name it as a like Remove_Objects.sqf  as example and i made a folder called Remove_Objects and placed this into a customs folder    example

then call it from your init.sqf like this

[] execVM "Custom\Remove_Objects\Remove_Objects.sqf";

 

i hope this is what you need gl

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Advertisement
3 hours ago, hogansheroes said:

this is what i use

i hope this is what you need gl

So instead of placing something (object, logic, etc) at the center of where I need objects cleared, I just copy and paste their coord into that script. And I don't have an init.sqf, just the local/server files. Does that mean I need to create the init.sqf to place into the mission folder?

Share this post


Link to post
Share on other sites
1 hour ago, Ninja2dan said:

So instead of placing something (object, logic, etc) at the center of where I need objects cleared, I just copy and paste their coord into that script. And I don't have an init.sqf, just the local/server files. Does that mean I need to create the init.sqf to place into the mission folder?

sent you a pm

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.