Home   Help Search Login Register  

Author Topic: How to detect if an object is a road section?  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

Offline lendrom

  • Members
  • *
How to detect if an object is a road section?
« 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?
Blessed are those who have nothing to say and yet they remain silent.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: How to detect if an object is a road section?
« Reply #1 on: 17 Mar 2008, 12:08:30 »
I think you cannot because these have no class names you may check for.

Offline lendrom

  • Members
  • *
Re: How to detect if an object is a road section?
« Reply #2 on: 17 Mar 2008, 13:28:32 »
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?
Blessed are those who have nothing to say and yet they remain silent.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: How to detect if an object is a road section?
« Reply #3 on: 17 Mar 2008, 13:45:06 »
It makes sense, as long as roads are returned by nearest object command (I think it doesnt).

Offline lendrom

  • Members
  • *
Re: How to detect if an object is a road section?
« Reply #4 on: 17 Mar 2008, 13:59:18 »
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.
Blessed are those who have nothing to say and yet they remain silent.