Jump to content
Sign in to follow this  
mr_centipede

What are the differences between nearestObjects and nearEntities?

Recommended Posts

Just like the title says, what are their differences? I looked at BIKI but at first glance it seems similar. So are there any differences between the two?

Share this post


Link to post
Share on other sites

well, the nearest object is listed first sticks out for me.

maybe try reading and not glancing ;)

Share this post


Link to post
Share on other sites

then how about nearObjects and nearIdentities then? I guess what I'm asking is what is Entity and what is Object?

is Entity == Object?

Share this post


Link to post
Share on other sites

yeah, Entity == Object.

only difference i see is that nearestObjects list nearest one first, and its not descibed in nearEntities, maybe that makes entities faster, since it doesnt calculate distance for all before filling them into list

SO: nearEntities is fast but unstructured in list, nearestObjects is slower but listed according to distance from point.

by slower, i mean more CPU intensive.

entity == alive

object == anything

Edited by Demonized

Share this post


Link to post
Share on other sites

How I see it an entity can be most things that you see even flies and seeds but objects exclude these.

Don't know what I was thinking, but flies and seeds are Agents not Entity.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

after some testing, it seems nearEntities only return alive items, lasermarker activated is a "alive target", gamelogic aswell.

all those is included in nearestObjects list, along with all other items like buildings and rcks.

so:

entity == alive(in some way)

object == alive or dead whatever.

edit:

testing done with:

_null = [] spawn {

_obj = nearestObjects [player, ["All"], 1000];
_ent = (position player) nearEntities [["All"],1000];

player sideChat format["obj is %1 /n ent is %2",(count _obj),(count _ent)];
hint format["only obj is %1",_obj];
sleep 5;
hint format["only ent is %1",_ent];
sleep 5;

_list1 = _obj - _ent;
_list2 = _ent - _obj;

hint format["only obj is %1",_list1];
sleep 5;
hint format["only ent is %1",_list2];

};

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  

×