Nexela / Nanobots

Early version of ghost building construction bots. Allows researching automated construction earlier (for blueprints etc)
MIT License
31 stars 22 forks source link

Raise script_raised_revive instead of on_built_entity #99

Closed mspielberg closed 4 years ago

mspielberg commented 5 years ago

Klonan's Construction Drones uses the script_raised_revive event newly added in 0.17, by passing raise_event = true to LuaEntity::revive. It would be nice to consolidate on this new event to simplify handling for other mods.

0ptera commented 4 years ago

I'd like to see all system events replaced by script_raised.

Event filtering only works for events raised by Factorio itself. Raising events like on_robot_built_entity in mods won't filter properly. Having just one mod raising system events requires all other mods to have additional filtering and validity checks in place.

Nexela commented 4 years ago

Some thoughts on this. I do not plan on switching to script_raised in Nanobots. Mining currently uses player.mine events so for consistency the build events will use on_built events. (switched to player built in the latest release) Event filtering was introduced to reduce the overall amount of events you get. Just like checking for .valid you should still check that the event applies to you.