Page 1 of 1

Keeping track of all the things

Posted: Sat Mar 16, 2019 6:19 pm
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

Re: Keeping track of all the things

Posted: Sun Mar 17, 2019 3:24 am
by DaveMcW
That looks like the complete list to me.

Re: Keeping track of all the things

Posted: Sun Mar 17, 2019 9:19 pm
by danielbrauer
Thanks for the confirmation. Hooking into these calls does seem to be working.

Re: Keeping track of all the things

Posted: Tue Mar 19, 2019 12:40 am
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.

Re: Keeping track of all the things

Posted: Wed Mar 20, 2019 11:03 am
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!