What
Any method to do the opposite of LuaEntity.revive(). Possibly as an extra argument to LuaEntity.destroy()?
Why?
Because LuaEntity.die() has several undesired side-effects: It makes noise, it creates remnants and it *doesn't* even create a ghost if the force doesn't have construction robotics yet.
LuaEntity.unrevive() turn an entity into a ghost
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
LuaEntity.unrevive() turn an entity into a ghost
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: LuaEntity.unrevive() turn an entity into a ghost
You can manually change the force's ghost_time_to_live to be a positive number to force a ghost to spawn on entity death.
Code: Select all
local force = entity.force
local ttl = force.ghost_time_to_live
force.ghost_time_to_live = 60 * 60 * 60 --1 hour
entity.die()
force.ghost_time_to_live = ttl
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: LuaEntity.unrevive() turn an entity into a ghost
Yea, and if the remnants are decoratives i could probably deal with those too. But that makes a rather ugly+complicated hack that still makes an ugly death noise - for something that should be simple.
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.