Prison Architect

Prison Architect

Not enough ratings
GetNearbyObjects Demo
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
1.604 MB
18 Aug, 2016 @ 9:51am
1 Change Note ( view )

Subscribe to download
GetNearbyObjects Demo

In 1 collection by murgh
Murgh Mods
75 items
Description
I always assumed GetNearbyObjects() would return a square of objects, but it turns out some objects on the edge of that square would not be found unless the range was set higher. I've read posts about GetNearbyObjects() not being reliable, so I tried to figure out why.

Therefore I made this little test map with a square of sprinklers and a fire alarm scanning those sprinklers to see how many sprinklers it would find in a given range. When turning the stuff on, the riddle was solved immediately: GetNearbyObjects() returns objects in a circle around the scanning object, and not in a square.

I have no idea if this should be a bug report or a feature request - is this intentional behaviour of this commonly used function? If so, then it makes GetNearbyObjects() a lot less reliable and misunderstood by modders.
Anyway, I have filed this issue on the bug tracker.


Please don't forget to press the Like button if you like this map.
Feel free to check out my workshop with tons of handy mods!

Non-Steam users: follow this guide to download manually.
3 Comments
murgh  [author] 28 Aug, 2016 @ 3:11pm 
The mod for this map has been updated to scan stuff in a square now. A backup of the old evac alarm script (scanning in radius) still exists in the scripts folder if you want to mess around with it.
TorMechia 27 Aug, 2016 @ 1:26pm 
*your
TorMechia 27 Aug, 2016 @ 1:26pm 
Thanks for you deed!