Jump to content
ArmaFiend

New-nearestTerrainObjects get a list of.....

Recommended Posts

Alright, works like a dream. Next question is what to do with the output:

[1076539: dp_transformer_f.p3d]

It returns an array, but not an object. The numbers represent the ID number of the map object.

 

How do I use the returned array information, e.g. check if alive object?

 

That is an object in an array. All map objects look like that as strings.

 

 

Alright, works like a dream. Next question is what to do with the output:

[1076539: dp_transformer_f.p3d]

It returns an array, but not an object. The numbers represent the ID number of the map object.

 

How do I use the returned array information, e.g. check if alive object?

 

 

array = nearestTerrainObjects [pos, [map types], radius]
Returns a list of nearest objects of the given map types to the given position or object, withing the specified distance.

Example:
nearestTerrainObjects [player, ["bush","chapel","fuelstation","tree","powerwind","rock"], 200]
 

 

 

 

This is all i have found on nearestterrainObjects.   From testing I know the output [1076539: dp_transformer_f.p3d,1076539: dp_transformer_f.p3d,1076539: dp_transformer_f.p3d] is what I get from a variety of map objects.  I have not be able to use this array other that in hints and copytoclipboard which is cool and nice, but not what I want.

 

Has anybody used/tested this command now that it is live.

Currently hideobject works :).  If anyone's interested I created a quick ares addon custom module to clear all map objects in a predetermined area. For Zeus construction.... soon to be Nexus I believe as Nexus will run scripts within it and has addons.

 

Its Beautiful!

If I learn some dialog scripting for variable radius i'll let you, and the ares guys know.  

 

 

Not sure if alive works... yet, because I want to make a powergrid without these dam triggers.

 

Share this post


Link to post
Share on other sites

Before applied to town center x1000 and After

 

http://imgur.com/a/cICvy

 

 

Well there has to be a map type for objects and there are also wall gates left over.

Any ideas on map types other than

"wall","house","bunker","bush","busstop","chapel","church","command","cross","fortress","fuelstation","hospital","lighthouse","power","powerwave","powerwind","rock","ruin","shipwreck","smalltree","stack","tourism","transmitter","tree","viewtower"

not sure on any of these... they work.

Share this post


Link to post
Share on other sites

Everything is included if you omit the type filter:

nearestTerrainObjects [player, [], 2000]

 

I don't where you can find all the possible types, but there's at least "Wall" and "Fence" missing from your list.

 

 

Share this post


Link to post
Share on other sites

Everything is included if you omit the type filter:

nearestTerrainObjects [player, [], 2000]

I don't where you can find all the possible types, but there's at least "Wall" and "Fence" missing from your list.

Thanks! Yup that with a large radius will remove all map objects... though I did still have power lines.

Its weird to see Altis without any map objects.

Share this post


Link to post
Share on other sites

Idea/project 2 Altis/Statis Prewar

Any thought on the map type of those trash/carts/food/wecks are in which I missed in the first pic.

map -map object items +JBAD buildings -distroyed building class names = Clean and new towns and cities for all.

Note: hide object needs damage dissabled also. Cars and people had no reaction. Arty made buildings with damage pop back in.

Share this post


Link to post
Share on other sites

according to fnc_codeperformance, nearestterrainobjects is faster than nearestobjects.

['count nearestterrainobjects [dd, ["House"], 100]'] call BIS_fnc_codeperformance  = 0.148144 ms

['count nearestobjects [dd, ["House"], 100]'] call BIS_fnc_codeperformance = 0.196469 ms

Though it's worth mentioning that the two expressions themselves returned different counts. In the middle of Kavala, dd being the player object.

count nearestterrainobjects [ dd, ["house"], 100] // 56

count (nearestObjects [dd, ["house"], 100]) // 54

So I'd be interested in why there's a discrepancy, You can't use house_f in nearestterrainobjects, so it clearly isn't running off the cfgvehicles hierarchy.

 

Looking at it's syntax, nearesterrainobjects is closely related to it's nearestobjects cousin, it can accept more than 1 classname in the array of filters. Both have inbuilt sort-by-distance routines which makes them CPU heavy.

 

This leads me onto an unashamed feature request;  nearterrainobjects, Similar in syntax to nearObjects  and devoid of a sort routine, for a much lighter cpu load.

 

http://feedback.arma3.com/view.php?id=27288

  • Like 1

Share this post


Link to post
Share on other sites

Further to the above request... without distance sorting...


['count dd nearobjects ["House", 100]'] call BIS_fnc_codeperformance =  0.0375 ms

See how much faster it is? A nearterrainobjects version would be sexy.

Share this post


Link to post
Share on other sites

I'm a little late and misunderstanding this, but are you trying to get all classes? of everything?

I have a script made by Zone Killer.

if he doesn't mind ill post it here later (after I get permission).

Share this post


Link to post
Share on other sites

*terrainobject commands are useful because (I assume) they ignore sqm or script spawned objects. They only find objects in the world map.They are the opposite of the *entities commands which ignore everything *except* sqm and script spawned objects.

I'm asking primarily because I have a script that takes a long time to complete and it would be much faster if we had the nearterrainobjects command.

My feedback ticket has been assigned, so that's great news. Shouldn't stop nice people voting it up though. :)

 

http://feedback.arma3.com/view.php?id=27288

 

Another approach is always good to see, though, Jim. Let's see what you got. :)

Share this post


Link to post
Share on other sites

I've been using nearestterrainobjects again recently so I thought I'd revisit this thread.

 

Firstly, I'm grateful for the guys for putting in place my feature (my post above in January of last year) request re turning off the sort routine. Don't know if my request had anything to do with it actually happening, but I don't care. :) Either way, it's wonderful, thanks.

 

But I'm still confused about the type names it uses. Why are overhead powerlines classed as a hide? "fuelstation" returns fuel pumps, but the fuel station buildings are "house". "view-tower", "railway", "main road" never return anything, "rock" works, but "rocks" is empty. Don't search for "hide" with a big radius unless you want to kill your game.

 

There's a lot of inconsistencies here. Some further info would be very welcome.

 

 

Share this post


Link to post
Share on other sites

Correction; "railway" does indeed return railways track pieces.

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

×