RimTerritory
Territories for mods.
This is C# code that triggers events when thing enter/exit/stay in the certain areas on the map.
You can check out github readme code examples.
It’s not perfect, but I found this pretty helpful and easy to setup territories for things from code.
It uses Territory class as basis, it can be initialized by Thing(including its size) or by position on the map(not world one).
To locate things in territory, you need to use Territory.Locator<ThingType> and call its Tick in the Tick() method of thing.
Locating is delayed and optional(default 10 ticks), you can set it with property TicksDelay.
There’s multiple types of territories, but you can create custom one by overriding Cells property or GetCells method.
This mod is not for XML, only C#, look at source code.
This mod is dependency and can be used in other mods.
Source code[github.com]