Dcrew Posted July 26, 2019 Share Posted July 26, 2019 As the title suggests, is there a way to do this without having to loop through every ent in the game since that wouldn't be great on performance if done often? Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/ Share on other sites More sharing options...
Wolf_EX Posted July 26, 2019 Share Posted July 26, 2019 most scripts use this and I seen it used in a loop so I'd imagine it can't be that slow. local x, y, z = inst.Transform:GetWorldPosition() local ents = TheSim:FindEntities(x, y, z, radius, {"TAGS"}) Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1233150 Share on other sites More sharing options...
Dcrew Posted July 26, 2019 Author Share Posted July 26, 2019 (edited) what's the coords & radius in? tiles or? Edited July 26, 2019 by Dcrew Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1233193 Share on other sites More sharing options...
Ultroman Posted July 26, 2019 Share Posted July 26, 2019 Whichever the basic distance measure is in The prototypers have a range of 4, but it seems the range in tiles is, like, 2. Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1233348 Share on other sites More sharing options...
Dcrew Posted July 27, 2019 Author Share Posted July 27, 2019 The prototypers? Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1233899 Share on other sites More sharing options...
Developer zarklord_klei Posted July 27, 2019 Developer Share Posted July 27, 2019 a tile is 4 units wide by 4 units long. Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1233962 Share on other sites More sharing options...
Ultroman Posted July 27, 2019 Share Posted July 27, 2019 4 hours ago, Dcrew said: The prototypers? Yeah...the science machine, alchemy machine, etc. Link to comment https://forums.kleientertainment.com/forums/topic/109446-query-position-get-all-ents-within-a-radius/#findComment-1234028 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now