Page 1 of 1

agricultural-tower radius is not reflected ingame

Posted: Sun Apr 19, 2026 10:46 pm
by MoltenOre
Hi,
i have a problem. When calling the prototype.radius of any type = "agricultural-tower", i get a converted radius number back during control.lua!
for example i define in the prototype
growth_grid_tile_size = 2,
radius = 4,

when i call prototye.radius i get an api return like this
r = 2.6847960598177

how can i get the real radius that is defined in the file? during final fix the protoype radius is still correct but when ingame it suddenly is this wired number!
this is what i have:

https://github.com/MoltenOre/Show_Agri_Range

I appreciate any help

Re: agricultural-tower radius is not reflected ingame

Posted: Mon Apr 20, 2026 4:15 am
by evanrinehart
By the way showing the range of the agricultural tower was recently mentioned in "fixed in 2.1"

Re: agricultural-tower radius is not reflected ingame

Posted: Mon Apr 20, 2026 6:00 am
by boskid
LuaEntityPrototype::radius returns radius of the collision bounding box, which by the docs is "half the distance between top left and bottom right corner". If you want agricultural-tower's radius you may need to use LuaEntityPrototype::agricultural_tower_radius.

Re: agricultural-tower radius is not reflected ingame

Posted: Mon Apr 20, 2026 5:55 pm
by MoltenOre
Thank you,

it was LuaEntityPrototype::agricultural_tower_radius this was the fix.

I was confused why it changes names from prototype definition to LuaEntityPrototype