on_unit_created

Place to get help with not working mods / modding interface.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

on_unit_created

Post by darkfrei »

Hi all!
How to get units spawning event?
Rseding91
Factorio Staff
Factorio Staff
Posts: 16016
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_unit_created

Post by Rseding91 »

There is currently no such event. What would you want it for?
If you want to get ahold of me I'm almost always on Discord.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: on_unit_created

Post by darkfrei »

Rseding91 wrote:There is currently no such event. What would you want it for?
Take entity.unit_number and call on_tick one of them.

It was a mod idea, where two enemies (biter + spitter) have chance to make one a new unit with higher tier. Two first are dying after it.

Scan chunks for units can be much slower and it's easy to call unit from the table.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: on_unit_created

Post by DaveMcW »

It would be much easier to upgrade a spitter spawner to a super-unit spawner if there is a biter spawner nearby.
Post Reply

Return to “Modding help”