events.on_territory_changed

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
LeonSkills
Inserter
Inserter
Posts: 27
Joined: Mon Feb 11, 2019 12:37 pm
Contact:

events.on_territory_changed

Post by LeonSkills »

2.0.61 introduced on_territory_created and on_territory_destroyed, as well as get/set/clear_territory_for_chunks(). Which is great! Thanks.

With the events we can track which chunks belong to which segmented_unit. However it's not possible to keep track of these chunks when other mods change the territories using one of the functions, without continuously checking the territories.

Request is to add a on_territory_changed event which is raised when clear_territory_for_chunks() or set_territory_for_chunks() is called.

Ideally the event is also raised when new segmented units are added to/removed from the territory (when writing to LuaSegmentedUnit.territory for example), so we know when territories become occupied/vacant.

---

The documentation also mentions in set_territory_for_chunks:
It is your responsibility to update the patrol path if needed.


Which is currently not possible if patrol path and territory management are handled by different mods.
Post Reply

Return to “Modding interface requests”