Jump to content
Sign in to follow this  
fabrizio_t

Nearobjects and trees + bushes

Recommended Posts

Hi,

i am looking for some way to find out cover positions through the "nearestObjects" function, i wish to find position of nearby tree / bushes, but i miss the TYPE for these vegetation "objects".

Seems many trees/bushes do not have a TYPE (TypeOf returning null string).

Can anybody help? Thx

Share this post


Link to post
Share on other sites

They have no config definition. Maybe not possible to query via scripts..

Share this post


Link to post
Share on other sites

The nearestObjects command can return objects without class definitions.

Example:

(nearestObjects [player,[], 10]) - ((getPos player) nearObjects 10)

will return unclassed objects within 10m of the player

Share this post


Link to post
Share on other sites
The nearestObjects command can return objects without class definitions.

Example:

(nearestObjects [player,[], 10]) - ((getPos player) nearObjects 10)

will return unclassed objects within 10m of the player

Sounds like an interesting workaround. Thanks, ceeeb i'll check it out.

Share this post


Link to post
Share on other sites
Sounds like an interesting workaround. Thanks, ceeeb i'll check it out.

The problem is that it will also return bees and whatever is near the unit. May look funny if a unit tries to hide behind a bee :D

I've made a script some time ago that stringifies the p3d name of all nearestObjects and checks for specific tree names inside that string (needed it to delete some trees arround a point).

Try something like this, but it is a very expensive operation.

Xeno

Share this post


Link to post
Share on other sites
The problem is that it will also return bees and whatever is near the unit. May look funny if a unit tries to hide behind a bee :D

Actually the code example I provided only returns unclassed objects. These are generally objects such as vegetation, fences, buildings and roads. As you say, detecting which of these objects is appropriate for hiding behind quickly & efficiently is going to be the hard part.

Share this post


Link to post
Share on other sites
Actually the code example I provided only returns unclassed objects. These are generally objects such as vegetation, fences, buildings and roads. As you say, detecting which of these objects is appropriate for hiding behind quickly & efficiently is going to be the hard part.

I did the this way ... used the output provided by your example, checked bounding box for each end every object (keeping only ones "big" enough and trashing roads), added nearestObjects ouput for some types like "Car", "Truck", "House" ... so i got a very RAW collection of cover/concealing objects. Not efficient for sure, but sleek :)

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×