Keeping track of all the things

Place to get help with not working mods / modding interface.
Post Reply
danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Keeping track of all the things

Post by danielbrauer »

I'd like to have a list of all science labs at all times. Obviously doing this with find_entities_filtered every frame is a colossal waste. Does the API provide all the events I need to maintain my list? I'm not 100% sure which events I should be looking at:

Code: Select all

on_built_entity
on_entity_cloned -- When does this happen?
on_entity_died
on_player_mined_entity
on_robot_built_entity
on_robot_mined_entity

-- for these ones, I'm relying on other mods to be good neighbours and call them
script_raised_built
script_raised_destroy
script_raised_revive

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Keeping track of all the things

Post by DaveMcW »

That looks like the complete list to me.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Keeping track of all the things

Post by danielbrauer »

Thanks for the confirmation. Hooking into these calls does seem to be working.

AlienX
Fast Inserter
Fast Inserter
Posts: 103
Joined: Wed May 17, 2017 7:13 pm
Contact:

Re: Keeping track of all the things

Post by AlienX »

Just to answer your question of when does "on_entity_cloned" happen.

This will be when the player uses the Cloning Tool on the Editor, you can activate the editor on any game with /editor in the console, however it may disable achievements.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Keeping track of all the things

Post by danielbrauer »

AlienX wrote:
Tue Mar 19, 2019 12:40 am
Just to answer your question of when does "on_entity_cloned" happen.
Thanks for the info!

Post Reply

Return to “Modding help”