Page 1 of 1

Are you listening....? (to the script_raised_revive event)

Posted: Tue Jul 16, 2019 1:53 pm
by ownlyme
I recently discovered that basically all of my mods are incompatible with klonan's "construction drones"
https://mods.factorio.com/mod/Construct ... 000ddd66a4

Re: Are you listening....? (to the script_raised_revive event)

Posted: Tue Jul 16, 2019 2:31 pm
by Klonan
So make your mods compatible by using the base game scripting feature designed for exactly the situation that construction drone uses it for.

Mods shouldn't be raising created events manually in this situation, it leads to many incompatibilities and problems,
The script_raised_revived is exactly the event that should be used when a mod is reviving a ghost

No mod will adjust if everybody keeps using the old inferior method, the status quo would be upheld
So it is a good position that I am obligated to take for the greater good, to use the new feature that is meant for the situation.

Re: Are you listening....? (to the script_raised_revive event)

Posted: Tue Jul 16, 2019 3:55 pm
by eradicator

Code: Select all

{on_built_entity,on_robot_built_entity,script_raised_built}
Honestly all my build/remove handlers listen to "triplets" and at this point i ask myself why they're three seperate events at all (except for historical reasons), as i can't think of any common situation where a mod would want them seperate. Also a problem with script_raised_* in general is that it's not properly sanitized and can contain garbage like invalid entity wrappers (as far as i remember). In my own code i invented "event groups" for this very reason, so i just subscribe to "group_on_built", but people updating their old mods won't know of new 0.17 features if they don't get external hints.

Re: Are you listening....? (to the script_raised_revive event)

Posted: Tue Jul 16, 2019 11:08 pm
by DaveMcW
In 0.17, you need to listen to 5 events to catch every entity.

on_built_entity
on_robot_built_entity
script_raised_built
script_raised_revive
on_entity_cloned

To make it more awkward, they use different parameters to store the entity.

on_built_entity - created_entity
on_robot_built_entity - created_entity
script_raised_built - entity
script_raised_revive - entity
on_entity_cloned - destination