Creation Event for Biter nest and worms

Post Reply
Veden
Filter Inserter
Filter Inserter
Posts: 294
Joined: Wed Jul 13, 2016 3:54 pm
Contact:

Creation Event for Biter nest and worms

Post by Veden »

Would it be possible to expose an event for when biter nest and worms are created?

Something similar to on_built_entity

It would be much more efficient than scanning the map using calls to find entities.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Creation Event for Biter nest and worms

Post by Rseding91 »

That's just map generation. Listen to the chunk generated event.
If you want to get ahold of me I'm almost always on Discord.

Veden
Filter Inserter
Filter Inserter
Posts: 294
Joined: Wed Jul 13, 2016 3:54 pm
Contact:

Re: Creation Event for Biter nest and worms

Post by Veden »

That works great for the initial scan.

The problem is when the AI creates bases during the course of a game after the chunks have been generated.

In order to keep the mod state current with the map, I'm forced to do a slow scan because I can't tell when or where new bases are created outside freshly generated chunks.

The other option is to turn off the ai_controllable for the enemy force and run all custom logic for building bases in order to track when and where they are created outside freshly generated chunks.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Creation Event for Biter nest and worms

Post by orzelek »

I had an interface request at some point to generate event when enemies are going to build a base to allow mods to potentially replace that base with custom one. I think it got lost in the mists of request forum.
For you it would be neough to get info that base has been built - it would also work to potentially replace that base with custom one for other mods.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Creation Event for Biter nest and worms

Post by Rseding91 »

Added for 0.15.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Implemented mod requests”