Request for scripting, how to turn off indestructible
Is it possible to put a script into control.lau to change map items from indestructible to normal destructible?
thanks
P.S. opening editor for each and on turning it off is a drag
Request for scripting, how to turn off indestructible
Re: Request for scripting, how to turn off indestructible
Depending what you're doing, maybe. From https://lua-api.factorio.comlatest/LuaEntity.html:
Code: Select all
destructible :: boolean [Read-Write]
When the entity is not destructible it can't be damaged.
Note: An indestructible entity can still be mined.
Note: Entities that are indestructible naturally (they have no health, like smoke, resource etc) can't be set to be destructible.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Request for scripting, how to turn off indestructible
Code: Select all
/c for _,entity in pairs(game.surfaces.nauvis.find_entities()) do entity.destructible = true end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Request for scripting, how to turn off indestructible
[Koub] Moved to Technical Help.
Koub - Please consider English is not my native language.