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.
Creation Event for Biter nest and worms
Re: Creation Event for Biter nest and worms
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.
Re: Creation Event for Biter nest and worms
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.
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.
Re: Creation Event for Biter nest and worms
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.
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.
Re: Creation Event for Biter nest and worms
Added for 0.15.
If you want to get ahold of me I'm almost always on Discord.