Destruction is only one of the many examples of how another mod could change the entity in ways that are incompatible with what i want to do with it, before i get to touch it. And ofc i don't know if or how other mods have changed it, so i'd have to check every property of *my* newly created entities as if they were foreign objects, just on the off-chance that some other broken mod fucks them up.justarandomgeek wrote: ↑Sun Nov 10, 2019 9:06 pmWhy bother wasting computing time configuring an entity that's just going to be destroyed?eradicator wrote: ↑Sat Nov 09, 2019 7:52 pm Btw, here's another usecase for manually raising on_build: If i use create_entity{raise_build=true} then another mod could destroy the created entity before i even ever see it. Thereformeans i have to care about less shit that other mods might do to my entities.Code: Select all
function() create_entity{raise_build=false} --dostuff script.raise_event(defines.events.on_built,...) end
Want to spawn an assembler with modules? Better clear the module inventory first.
Want to spawn an assembler with a recipe? Better make sure the in/output inventories are empty.
Etcpp.
Not being able to rely on newly created entities being actually fresh and untouched makes any further manipulation a potential error source.