D. Patterson 14 Posted November 16, 2014 (edited) I want to delete all objects on the map with a specific classname (At the start of the mission only), Land_City_8m_F and Land_City_8mD_F, whats the best way to do this? Edited November 16, 2014 by mcrow900 Share this post Link to post Share on other sites
jshock 513 Posted November 16, 2014 (edited) I want to delete all objects on the map with a specific classname (At the start of the mission only), Land_City_8m_F and Land_City_8mD_F, whats the best way to do this? init.sqf { if (_x typeOf "Land_City_8m_F" || _x typeOf "Land_City_8mD_F") then { deleteVehicle _x; }; } forEach nearestObjects [player, ["All"], 1000000]; Edited November 16, 2014 by JShock 1 Share this post Link to post Share on other sites
dreadedentity 278 Posted November 16, 2014 If it's a default map object, I'm not sure there's an easy way to do that. You might consider remaking altis/stratis as a separate map at this point Share this post Link to post Share on other sites
jshock 513 Posted November 16, 2014 If it's a default map object, I'm not sure there's an easy way to do that. You might consider remaking altis/stratis as a separate map at this point Dread is correct, my code will only work if these objects were created in some way, I don't believe there is a way to delete default map objects. Share this post Link to post Share on other sites
Tajin 349 Posted November 17, 2014 That depends. As far as buildings are concerned, you can delete them by destroying them then deleting their ruins. Share this post Link to post Share on other sites
Kerc Kasha 102 Posted November 17, 2014 hideobject does the trick Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted November 17, 2014 I have the exact code you are looking for, but you have to do it for each building/already placed item. So, if you're trying to clear out kavala, you should probably find something else. I will post the code in ~1 min. Share this post Link to post Share on other sites
Tankbuster 1747 Posted November 17, 2014 hideobject does the trick hideObjectGlobal is even better. Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted November 17, 2014 Here are the steps: Put down an empty helipad above the house you plan on removing. In its init, place the following code: this enableSimulation false; this allowDamage false; delh = [0,0,0] nearestObject 99999; delh hideObject true; The number I put in (99999) is the building ID - you can find this by clicking the "ID" button at the top of the editor and zoom in all the way to see the ID's. Find the ID of the one you want to remove and place that ID into where my 99999 is. 1 Share this post Link to post Share on other sites
Booker- 2 Posted June 7, 2017 On 11/17/2014 at 4:42 AM, Kerc Kasha said: hideobject does the trick Only problem is when you hide the object, that certain object is still there. Meaning if you wanted to shoot an enemy on the other side of the 'house'. You would be hitting the house, not the enemy. Keep this in mind when you hide any objects. Also, a note I might add, if you are driving and all of a sudden hit a 'object'. That would be the object that you have hidden. I use the Hide Terrain Objects to remove trash and other crap at my home base that does not need to be there. Cheers! Share this post Link to post Share on other sites
killzone_kid 1331 Posted June 7, 2017 39 minutes ago, Booker- said: Only problem is when you hide the object, that certain object is still there. Meaning if you wanted to shoot an enemy on the other side of the 'house'. You would be hitting the house, not the enemy. Keep this in mind when you hide any objects. Also, a note I might add, if you are driving and all of a sudden hit a 'object'. That would be the object that you have hidden. I use the Hide Terrain Objects to remove trash and other crap at my home base that does not need to be there. Cheers! Hidden objects should not cause obstacles. If they do, report it as a bug. 1 Share this post Link to post Share on other sites
Booker- 2 Posted June 7, 2017 40 minutes ago, killzone_kid said: Hidden objects should not cause obstacles. If they do, report it as a bug. Good to know. I just tested it and have found a few objects! Wonderful *Sarcasm*. Cheers! Share this post Link to post Share on other sites
Alert23 215 Posted June 7, 2017 place an GameLogic and name it "MyGameLogic" and in its init field put this: {_x hideObjectGlobal true } foreach (nearestTerrainObjects [myGameLogic,[],90000]) it will completly "delete"/hide every object. the last number is the radius in which the objects will be deleted Share this post Link to post Share on other sites
killzone_kid 1331 Posted June 8, 2017 7 hours ago, Alert23 said: {_x hideObjectGlobal true } foreach (nearestTerrainObjects [myGameLogic,[],90000]) it is better to limit it to the server and switch the sorting off if (isServer) then {{_x hideObjectGlobal true} forEach nearestTerrainObjects [[worldSize/2, worldSize/2], [], worldSize, false]} 1 Share this post Link to post Share on other sites
diehardfc 41 Posted March 6, 2018 I'm making a multiplayer mission on a jungle map with a lot of objects, but the players will be spending their time on only about a third of the map. Given that most map objects are simple objects, does anyone know if I would gain any performance improvement by hiding all terrain objects in the areas of the map that won't be used? Or is density of objects within viewDistance the actual area of concern when going for performance savings? Share this post Link to post Share on other sites
Mynock 244 Posted March 6, 2018 1 hour ago, diehardfc said: I'm making a multiplayer mission on a jungle map with a lot of objects, but the players will be spending their time on only about a third of the map. Given that most map objects are simple objects, does anyone know if I would gain any performance improvement by hiding all terrain objects in the areas of the map that won't be used? Or is density of objects within viewDistance the actual area of concern when going for performance savings? Be careful using the new editor module to hide hundreds or thousands of objects in an area if the mission has the ability to be "saved" (either through autosaves or manual player saves). I've noticed that trying to do a game save with tons of objects hidden by those modules cause the game to lock up and it spits out thousands of errors relating to the objects you have hidden. To more directly answer your question (well, sort of), when I tried hiding about half of a map, I noticed only minor improvements (like 1-3fps on average maybe) but it was a fairly small map. On a larger map you may notice a bigger difference. Ultimately I couldn't implement it though because of the save game issues I discovered. Share this post Link to post Share on other sites
diehardfc 41 Posted March 6, 2018 I'm implementing the idea on a dedicated server for a one-time, Zeus-based multiplayer mission involving a milsim group, so the save issue shouldn't be a concern. With 50 players and an equal number of AI units in thick jungle, things can get pretty bogged down during play, though, and other than shrinking view distance to the point where the helicopter pilots are being penalized, I'd love to find ways to improve performance. Share this post Link to post Share on other sites
damsous 329 Posted March 6, 2018 8 minutes ago, diehardfc said: I'm implementing the idea on a dedicated server for a one-time, Zeus-based multiplayer mission involving a milsim group, so the save issue shouldn't be a concern. With 50 players and an equal number of AI units in thick jungle, things can get pretty bogged down during play, though, and other than shrinking view distance to the point where the helicopter pilots are being penalized, I'd love to find ways to improve performance. Use TAW viewdistance script every player can adjust the view distance, you can decrease view and object under 500, in a dense jungle 300 m its enough and its pretty fast to adjust a higher or lower viewdistance. Hide object can help for exemple on Altis if you hide tree and other static object in a town frame are better when you enter the town, but for exemple if you hide half of the map and the part of the map you play nothing is hide you will improve nothing on performance Share this post Link to post Share on other sites
prisoner2519 0 Posted August 25, 2022 On 6/8/2017 at 10:09 AM, killzone_kid said: it is better to limit it to the server and switch the sorting off if (isServer) then {{_x hideObjectGlobal true} forEach nearestTerrainObjects [[worldSize/2, worldSize/2], [], worldSize, false]} Hi, does this reduce the server calculation/ does this help the server to work "faster"? I mean if I use ["Bush"], to hide all bushed from map or certain area. Share this post Link to post Share on other sites
pierremgi 4905 Posted August 25, 2022 42 minutes ago, prisoner2519 said: Hi, does this reduce the server calculation/ does this help the server to work "faster"? I mean if I use ["Bush"], to hide all bushed from map or certain area. Not really. Each time you want to script for a massive and permanent state (like hiding objects, bushes or else), you should run that locally, at start, instead of asking the server for the job. So, {_x hideObject true} forEach nearestTerrainObjects [[worldSize/2, worldSize/2], [], worldSize, false]; from init.sqf will have the same result without impact for server at each JIP. The global commands are more interesting for spawned objects (generally on server), then broadcasting a texture for example, globally. Share this post Link to post Share on other sites