The nearEntities command does not return objects of type WeaponHolder. Since there is no other method to find WeaponHolders other than nearObjects or nearestObjects performance is degraded heavily when searching large areas.
Description
Details
- Legacy ID
- 921377499
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Scripting
Drop an item from inventory, execute nearEntities on type WeaponHolder, nothing is returned. nearObjects does return.
A WeaponHolder should be classed as an entity.
Event Timeline
Perhaps intended, only simulated available at present.
[_pos nearEntities [["All"], 50], {typeof _x == "weaponholdersimulated"}] call BIS_fnc_conditionalSelect // [2c937200# 164051: dummyweapon.p3d]
[_pos nearEntities [["All"], 50], {typeof _x == "weaponholder"}] call BIS_fnc_conditionalSelect // []
[_pos nearEntities [["All"], 50], {typeof _x == "groundweaponholder"}] call BIS_fnc_conditionalSelect // []
Why downvote? Nearobjects takes 10ms where as nearentities takes fraction of that with 5000 radius.
Downvoted until demonstration that nearEntities will keep its good performance!
Actually, nearEntities doesn't return "objects" as flag pole, items, crates, fences... It returns man, agent, cars, tanks, "vehicles" intended as locomotion means.
NearObjects returns (almost) everything as each runway edge light! and all objects (edited or embedded in map).
Rather than making nearEntities heavier (slower), please consider a new function like nearLiveObjects allowing a sort in all workable objects (crates, weaponHolder, backpacks, men...) and no "boxes" like some Land_... on map just for scenery.