RimWorld
Оценок: 128
RimTerritory
   
Наградить
В избранное
В избранном
Удалить
Mod, 1.3, 1.4, 1.5
Размер файла
Добавлен
Изменён
337.689 KB
13 фев. 2023 г. в 7:23
7 мая. 2024 г. в 11:38
Обновлений: 3 (просмотреть)

Подпишитесь, чтобы загрузить
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]
Комментариев: 25
Onikage-056, God of Animatronics 11 апр. 2024 г. в 17:05 
Needs updating for 1.5. RimPy throws an error for it.
Giggles 20 июн. 2023 г. в 22:15 
Is this mod just framework or does it actually add stuff on its own?
MIS42NE  [создатель] 18 фев. 2023 г. в 10:34 
If you're interested in performance, I suggest you to benchmark this mod, or just calculate approximately by looking at the source code.
Sir Rolin 18 фев. 2023 г. в 10:16 
Pretty sure it depends on the mods that use it.
But to expand the question, is it as efficient as vanilla areas or better?
MIS42NE  [создатель] 18 фев. 2023 г. в 7:22 
added note that territory not in the world map
TeleportBehindYou 18 фев. 2023 г. в 7:04 
Least you can do is add a disclaimer that lets people know that it's only in your faction base, not affecting the whole world map. Wish someone would make a mod for what I was talking about tho. Would be cool to see faction territories displayed graphically. Kind of like EU4.
MIS42NE  [создатель] 18 фев. 2023 г. в 6:25 
English is not my native language so I'm sorry for that mistake, however, I won't fix it. :maple2:
jupiterLILY 18 фев. 2023 г. в 5:57 
Yep, I think the word territory is going to cause confusion.

A territory is a larger area of influence than just a base.
TeleportBehindYou 17 фев. 2023 г. в 8:02 
Oh i see. So it's only for the "territory" within an faction's base? Like if a colonist were to stand in the kitchen for too long, a raid happens? I was thinking of territory on the world map.
MIS42NE  [создатель] 17 фев. 2023 г. в 7:53 
Um... Don't understand what you're asking for.
This mod is not about world map.
This is kind of API for other mods.
But I may add debug option to visualize territory bounds.