agricultural-tower radius is not reflected ingame

Place to get help with not working mods / modding interface.
MoltenOre
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Apr 19, 2026 10:08 pm
Contact:

agricultural-tower radius is not reflected ingame

Post 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
evanrinehart
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Fri Jul 31, 2020 11:16 pm
Contact:

Re: agricultural-tower radius is not reflected ingame

Post by evanrinehart »

By the way showing the range of the agricultural tower was recently mentioned in "fixed in 2.1"
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4456
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: agricultural-tower radius is not reflected ingame

Post 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.
MoltenOre
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Apr 19, 2026 10:08 pm
Contact:

Re: agricultural-tower radius is not reflected ingame

Post 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
Post Reply

Return to “Modding help”