[2.0.12] Demolisher API (territories & spawning?)

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Oarc
Fast Inserter
Fast Inserter
Posts: 121
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

[2.0.12] Demolisher API (territories & spawning?)

Post by Oarc »

Hello,

I tried to search and didn't see another request yet. But at some point, it would be nice to get access to Demolisher territories for modding purposes.

- Ability to tell what territories are on the map, if a chunk or map position is within a territory, if the territory is claimed or not.
- Maybe runtime ability to remove and create or reset territories?

Thanks!
ahicks
Inserter
Inserter
Posts: 24
Joined: Sat Jul 13, 2024 10:45 pm
Contact:

Re: [2.0.12] Demolisher API (territories & spawning?)

Post by ahicks »

We have to rethink how we do combat so we won't need this for a long time, but in order to expose demolishers to our players reasonably we will need to either get it via this or developing some lua-side approximated algorithm.
zanven
Inserter
Inserter
Posts: 31
Joined: Thu Jul 07, 2016 2:11 am
Contact:

Re: [2.0.12] Demolisher API (territories & spawning?)

Post by zanven »

i would also like a way to spawn demolishers with quality.

When you try to create entity by type with a quality property and its a demolisher it doesnt work and is an invalid luaEntity object while it does work with buildings / biter nests etc.

if i want to replace a demolisher with a new one, will the territory have a few ticks grace before unlocking so i can "delete then create replacement" ?

Will the spawning of units call for territories instead be a totally new interface so you spawn entities to a territory and the territory controls placement. i.e create_territory_unit(name,territory,force,quality)
teflillyphiliac
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Nov 10, 2024 10:39 am
Contact:

Re: [2.0.12] Demolisher API (territories & spawning?)

Post by teflillyphiliac »

I did some experimenting to find the at runtime limitations of modding demolishers. These seem to be the limitations as of 2.0.20:
- You cannot query the territory, although the demolisher-compass mod has a workaround by tracking the position of each demolisher as it moves around
- You cannot modify the territory, or create new territories
- You can create new demolishers, but they do not have a territory. They will instead patrol in a clockwise hexagon with a radius of about 2 chunks
- Newly created demolishers will still investigate and attack as if they have a territory, but unlike normal demolishers this area is larger than their patrol path. They kill any buildings within about a 4 chunk radius of their starting point
- Demolishers can be created on space platforms
- Demolishers cannot be cloned
- Demolishers cannot be teleported

For modding it would be very nice to query and modify the territory of demolishers at runtime. The usecases I am interested in is a mod where demolishers expand their territory over time into empty areas and a mod where their territory retreats slowly away from some repellent.
Post Reply

Return to “Modding interface requests”