gc8 970 Posted July 4, 2016 has anyone else noticed that findEmptyPosition command sometimes returns positions inside another object, like wall for example? This makes the spawned vehicle in the returned pos to fly or explode. maybe BIS could fix this :) ? Share this post Link to post Share on other sites
ceeeb 147 Posted July 4, 2016 I have noticed on Tanoa it will find positions inside some non-enterable buildings: https://feedback.bistudio.com/T117508 Share this post Link to post Share on other sites
gc8 970 Posted July 4, 2016 ok I have this issue with non-apex arma. Share this post Link to post Share on other sites
pierremgi 4739 Posted July 6, 2016 Good luck for a fix! BI doesn't seem to change anything in the jungle of classes. Some other abnormal behaviors: - nearestBuilding never takes into account the edited houses; - nearObjects (and similar commands) are returning some walls or even all runway lights as "house". That makes a lot of unwanted weird houses, with no building position, in game.... Share this post Link to post Share on other sites
gc8 970 Posted July 6, 2016 yeah, I had cover finding script in arma 2 but it doesnt work in arma 3 because the the objects returned by nearestObjects are so weird..... even when I had nearestObjects [_pp, ["Building"], _searchRadious ]; it returned objects that are not buildings... in arma2 it worked perfectly in takistan towns. Share this post Link to post Share on other sites
gc8 970 Posted November 12, 2017 Still have this same problem that when I create vehicles on the position returned by findEmptyPosition they sometimes explode. Is BIS not going to fix this? Or am I doing something wrong, hmmm? This is the code what I use: _foundPos = _scenter findEmptyPosition [0, 75, _vehicleType]; Share this post Link to post Share on other sites
AZCoder 921 Posted November 13, 2017 I totally have this problem. I have a custom ambient AI suite that I wrote, but I can't find a way to stop cars from intermittently exploding! Sometimes I find them inside a house even though they should be outside. I've tried ensuring they will keep a safe distance from all buildings, and they still find something to blow up on. I don't think you're wrong. Share this post Link to post Share on other sites
pierremgi 4739 Posted November 13, 2017 - start with isFlatEmpty, far more convenient, - then add your findEmptyPosition (why not?) but let some room for your object (you can use any by tank class instead of a quad if you want!) - as many mods are made with poor buildings (no door, no position), and Tanoa is also a pity for that!, you can add some check to avoid a roof above the position: ( call {lineIntersectsSurfaces [getPosWorld player, getPosWorld myObject vectorAdd [0, 0, 50], myObject, objNull, true, 1, "GEOM", "NONE"] select 0 params ["","","","_house"]; _house isKindOf "House"} ); // returns true or false Probably too much and CPU expensive... Share this post Link to post Share on other sites
gc8 970 Posted November 14, 2017 I'm now using BIS_fnc_findSafePos. It is using the isFlatEmpty with some additional checks to make sure the position is not inside of building. Getting much better results with this than findEmptyPosition but there's still explosions sometimes. Share this post Link to post Share on other sites
jakeplissken 77 Posted November 14, 2017 I use this, it is to create a random center point for an occupied area, but it works well. _gamelogic = CENTER; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomTownPosition = position (_towns select (floor (random (count _towns)))); _m = createMarker [format ["mrk%1",random 100000],_RandomTownPosition]; _m setMarkerShape "ELLIPSE"; _m setMarkerSize [900,900]; _m setMarkerBrush "BDiagonal"; _m setMarkerAlpha 0.5; _m setMarkerColor "ColorEAST"; _pos = getMarkerPos _m; _randPos = [_pos , 0, 600, 12, 0, 0.3, 0] call BIS_fnc_findSafePos; This code works very well to find an empty pos for a radio tower or a vehicle. Just place a gamelogic named CENTER and then run this code to find a position. Give this a go. Share this post Link to post Share on other sites
gc8 970 Posted November 14, 2017 Thanks for the code jakeplissken. I tried with BIS_fnc_findSafePos in malden airport and i spawned 50 vehicles to test it and one vehicle exploded when it was placed between two hangars. So pretty good result but not perfect. This is the code I used, it first looks for space within 150 meters and then raises the search area if no place is found: _loc = []; _args = [_ppos, 0, 150, 12, 0, 0.5, 0]; for "_s" from 0 to 2 do { _args set[2, (_args select 2) + (_s * 200)]; _foundPos = _args call BIS_fnc_findSafePos; if(count _foundPos > 0) exitwith { _loc = _foundPos; }; }; Share this post Link to post Share on other sites
pierremgi 4739 Posted November 14, 2017 You can use also nearRoads and a filter with sizeOf . Share this post Link to post Share on other sites