Jump to content
Sign in to follow this  
vova _fox

nearestobject id and all?1

Recommended Posts

As i understand only 'nearestobject id' command can find objects like trees, shapes..etc.

But it not universal, because id has various numbers and usually don't depend but it positions on isalnd.

I need more universal script \ function, that can find all objects at some position with some radius, with types and without types.

Any ideas?

Share this post


Link to post
Share on other sites
Quote[/b] ]As i understand only 'nearestobject id' command can find objects like trees, shapes..etc.

You can use nearestObjects to return all objects, classed and unclassed. eg: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nearestObjects [position player,[], 100]

edit:<s>I've added a note in the wiki, since this has come up before.</s> It was already noted in the wiki article wink_o.gif

Share this post


Link to post
Share on other sites

Hmm OK this is of interest to me. So will this command also return vegetation objects? If so does anyone know what format it's returned seeing as map vegetation objects do not have class names?

Share this post


Link to post
Share on other sites

My understanding is, it will not return vegetation objects placed in visitor . donegovol <(sp?) tried very hard to capture these and there is a thread somewhere or he is always on ofpec irc, maybe he did it who knows.

Share this post


Link to post
Share on other sites

rofl.gifrofl.gif

hahaha

i'am everytime type nearestobject [getpos player,["all"], 100]

i'am forgot that that objects aren't have classes

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nearestObjects [position player,[], 100]

Works great!

Thanks, fasad smile_o.gif

Share this post


Link to post
Share on other sites
Hmm OK this is of interest to me. So will this command also return vegetation objects?

Yes.

Quote[/b] ]If so does anyone know what format it's returned seeing as map vegetation objects do not have class names?

Format is <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"><objectID>: <model.p3d>

example:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">3801: stone3.p3d

To make use of the returned model p3d you probably need to use the slow string tool library to strip the objectID from the returned string, which is a not very realistic for real-time performance.

Share this post


Link to post
Share on other sites
Hmm OK this is of interest to me. So will this command also return vegetation objects?

Yes.

Quote[/b] ]If so does anyone know what format it's returned seeing as map vegetation objects do not have class names?

Format is <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"><objectID>: <model.p3d>

example:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">3801: stone3.p3d

To make use of the returned model p3d you probably need to use the slow string tool library to strip the objectID from the returned string, which is a not very realistic for real-time performance.

Aaah the string tool library? smile_o.gif linky winky pleasey biggrin_o.gif

The implementation I'm thinking of doesn't require real-time performance, I'd just like a list of vegetation within a radius (prolly have to manually weed out named models from a list) so I can work out a spreading fire pattern.

Share this post


Link to post
Share on other sites
Quote[/b] ]Aaah the string tool library? smile_o.gif linky winky pleasey biggrin_o.gif

You lazy bugger! smile_o.gifSearch results for topics containing "string" within mission editing & scripting (Hint : it was released by Kronzky)

If you are interested in performance, you might have to use Voyager's ArmA Extended DLL, which adds external string manipulation functions which must be faster than the ArmA script brute force method. I think Nutty_101's tools can do a similar task, but I haven't bothered to set up a dedicated server just to find out.

Share this post


Link to post
Share on other sites
Quote[/b] ]Aaah the string tool library? smile_o.gif linky winky pleasey biggrin_o.gif

You lazy bugger! smile_o.gifSearch results for topics containing "string" within mission editing & scripting (Hint : it was released by Kronzky)

If you are interested in performance, you might have to use Voyager's ArmA Extended DLL, which adds external string manipulation functions which must be faster than the ArmA script brute force method. I think Nutty_101's tools can do a similar task, but I haven't bothered to set up a dedicated server just to find out.

LOL, thanks for the link smile_o.gif but really you only had to say "Kronzky" and I would have been over at his site sniffing it out wink_o.gif

RE the extended DLL, that would be something that mission servers/players would need to have also though, right?

Share this post


Link to post
Share on other sites
Quote[/b] ]RE the extended DLL, that would be something that mission servers/players would need to have also though, right?

Well yes, at least the server (including hosted server, including SP) would need such a program. It's a balancing act : CPU time/power vs additional external requirements.

edit: I'd be trying the string library first.

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  

×