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
agricultural-tower radius is not reflected ingame
-
evanrinehart
- Long Handed Inserter

- Posts: 70
- Joined: Fri Jul 31, 2020 11:16 pm
- Contact:
Re: agricultural-tower radius is not reflected ingame
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
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
Thank you,
it was LuaEntityPrototype::agricultural_tower_radius this was the fix.
I was confused why it changes names from prototype definition to LuaEntityPrototype
it was LuaEntityPrototype::agricultural_tower_radius this was the fix.
I was confused why it changes names from prototype definition to LuaEntityPrototype

