When an agricultural tower is hovered over, the plants that it seeded are shown:
[AgriculturalTower only] LuaEntity::get_owned_plants() -> array[LuaEntity]
I imagine the game engine doesn't keep track of the reverse relation, and really only this is enough. But in case it's not too hard and conflicting to introduce, something along the lines of
[Plant only] LuaEntity::plant_owner -> read LuaEntity?
would also be very appreciated.
My use cases for both are yet again for Item Cam 2. Plants can be followed, or well, stared at as they grow, and when chopped I change focus from plant to mining result item in origin tower. Without being able to make a direct relation right now, I have to make an assumption - I switch focus to first nearby tower that it thinks is within its planting bounds, which can fail if there are multiple
It would be nice to have that exposed in runtime API, say with this signature:Plant - agricultural tower relations
Re: Plant - agricultural tower relations
We don't track plant owners at the moment, so I added only LuaEntity::owned_plants for 2.0.49. Keep in mind that a plant can be registered in multiple agricultural towers.
Re: Plant - agricultural tower relations
Thank you, genuinely! You lot are the best. This can be considered implemented in my opinion
Curious, would this mean that any one of the agricultural towers may mine that plant, or does it imply something else?Genhis wrote: Mon May 12, 2025 2:47 pm Keep in mind that a plant can be registered in multiple agricultural towers.
Re: Plant - agricultural tower relations
Correct, any of the towers can mine it.HermanyAI wrote: Mon May 12, 2025 5:28 pm Curious, would this mean that any one of the agricultural towers may mine that plant, or does it imply something else?