Hello, devs!
I have a doubt about how to get more tha one turf in a map topdown format which I have a obj 250x250 (icon size). I'm learning about physics and I already can centralize the physical start point. But how can I get all turfs in the obj area?
ID:2844985
Dec 31 2022, 6:10 am
|
|
I have a skill in a game which is basically a circle area with the player in the center. I want to get all mobs in the circle area if they touch the obj created by that skill. So, Maybe I'm thinking wrong, but I want that object (is only one object) to check if has some mob in his area and then fire a damage proc. Something like that!
|
Disregard the visual object, then. It's irrelevant. We just need to know the point at the center, and the radius. The visual object is just purely visual, and located over the spot you wanna to some target finding within.
BYOND only give you the ability to get the objects that intersect with rectangles. So we need to apply a little theory here. If we know the center and radius of the circle, we can create an AABB that will contain the circle: var/circle_d = circle_r * 2 So for each mob you find in testing, you are going to need to determine whether it's inside or outside the circle using the math below: //define the collision rectangle from ref's bounds |
If the object does not have physical bounds, you can get a block of turfs with block(), or a list of all atoms underneath an object or a rectangle with obounds()/bounds().
I'd have to know more about what you are trying to accomplish to point you in the right direction.