OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: lendrom on 17 Mar 2008, 11:18:59
-
I can't figure out how to detect if an object detected by nearestObjects function is a section of road. I tried to use boundingBox to check the height (as a matter of fact this is what I want to do - find all objects of a height bigger than 0.3 m - and that is why I want to exclude roads from my list) but I'm getting strange results (normal BIS road has about 4 meters of height). And the roads seam not to have defined class in config. I guess the solution is quite easy but I just can't figure it out. Any thoughts?
-
I think you cannot because these have no class names you may check for.
-
Ok, thanks for answer. So it's not that easy. But I'm quite sure it must be possible somehow. By using nearestObjects I get an array of object's IDs and their models (p3d). Could I take an advantage of knowing all the p3d that are used for roads? For example could I convert the array element eg. [object 29549: asf10 25.p3d] to string and check if part of the string matches one of elements of a global array eg. [asf01 00.p3d, asf02 00.p3d, etc]? Would it make any sense?
-
It makes sense, as long as roads are returned by nearest object command (I think it doesnt).
-
Well, I wish they weren't ;). I just need to get rid of them from the array of nearestObjects. I want to find objects for units to get cover (ie. objects which height is at least 0.3 m) but for some reason roads appear to have higher height that 0.3 m and in some areas I end up with soldiers going to the middle of the road when there's a lot of better cover in the area. And I know about getHideFrom command but I'm willfully not using it. I gues I'd have to look into those string conversion, I hoped I could avoid it.