woodstock 10 Posted May 14, 2013 Her's the init line I'm using in a gamelogic unit: {_x setdamage 1; } foreach nearestObjects [0,0,0, ["ANY"],25]; Where: {_x setdamage 1; } foreach nearestObjects [Position, ["ANY"],radius]; Got this from an old Arma 2 post. How can I make it work in Arma 3 to level an area? Thanks, Woodstock Share this post Link to post Share on other sites
KevsNoTrev 38 Posted May 14, 2013 (edited) try this [url="https://community.bistudio.com/wiki/nearObjects"][i]position [/i]nearObjects [i]radius [/i]or [[i]typeName[/i], [i]radius[/i]][/url] EDIT: Just realised I gave you the same command on this topic..... Edited May 14, 2013 by KevsnoTrev cross topics? Share this post Link to post Share on other sites
mindstorm 8 Posted May 15, 2013 (edited) {_x setdamage 1; } foreach nearestObjects [[0,0,0], [],25]; This will also get objects without a class. (trees, rockets and other stuff). Passing the array ["All"] is not the same and will only return objects that have some sort of class. Edited May 15, 2013 by mindstorm Share this post Link to post Share on other sites
woodstock 10 Posted May 15, 2013 Mindstorm - no errors but no effect. Is this the correct syntax for ArmA 3? I'm using this as an init line in a gamelogic unit. Should the setdamage come last? I played around a bit but keep getting syntax errors. Thank you. I'm learning from scratch here. Woodstock Share this post Link to post Share on other sites
killzone_kid 1222 Posted May 16, 2013 no effect because it is at 0,0,0 coordinates and the radius is only 25 metres. you need to move it next to you to see. Share this post Link to post Share on other sites
eagledude4 3 Posted May 16, 2013 I recently found a function that levels all buildings in a city. http://community.bistudio.com/wiki/BIS_fnc_destroyCity It's an arma2 function, so not sure if it works with arma3. Share this post Link to post Share on other sites
soolie 184 Posted May 16, 2013 i use that and it works great. Where you place it is the center destroying most buildings, and moves outward in a circle doing less damage the further away from the center. Here's mine, Variable definitions are copy pasted from the wiki. Anyone know what seed means? I just left 42 bc its on the example in the wiki. ["epicenter1",300,42] call bis_fnc_destroyCity; Variables position: Array (in format position) or Object (object position) or String (marker position) areaSize (Optional): Number - area diameter (default is 1000) seed (Optional): Number - random seed (default is 1138) blacklist (Optional): Array of blacklisted objects (default is an empty array) Share this post Link to post Share on other sites
mindstorm 8 Posted May 16, 2013 So make a maker on the map where you wanna destroy a city. Call it whatever you want. Then: {_x setdamage 1; } foreach nearestObjects [getMarkerPos "yourmakername", [],500]; Alternatieve you can use the above function soolie named: ["yourmakername",500,42] call bis_fnc_destroyCity; The seed is a random used to calc the amount of damage done. Just to make sure the destroy looks different each time. Share this post Link to post Share on other sites
killzone_kid 1222 Posted May 16, 2013 I recently found a function that levels all buildings in a city. http://community.bistudio.com/wiki/BIS_fnc_destroyCity It's an arma2 function, so not sure if it works with arma3. It randomly destroys building parts, not level them. To level building you need to setDamage 1 to it. Share this post Link to post Share on other sites
woodstock 10 Posted May 16, 2013 OK. What the hell? Neither of these work. 1. We're talking ArmA 3 right? 2. I'm using the code as init in a game logic unit. 3. Using code verbatim as above and inserting the name of my game logic unit, or another object, as the "yourmarkername" variable. No damage at all. Am I missing something I need to move over from ArmA 2? Woodstock Share this post Link to post Share on other sites
killzone_kid 1222 Posted May 16, 2013 put this in your player init field player allowDamage false; {if (_x != player ) then {_x setdamage 1;} } foreach nearestObjects [position player, [], 500]; it will destroy everything that can be destroyed in 500 metres radius Share this post Link to post Share on other sites