[0.17.x] Determine if a ghost was on a tile when something was built
Posted: Mon May 13, 2019 2:26 am
Factorio is at version 0.17.38 and my question is this:
How can I determine if a ghost was on a tile, when something was built there? And what kind of ghost was that?
To detail and clarify the question: I am not interested in determining if an entity or tile was built BECAUSE of a ghost. I simply want to know if a ghost was on a tile before something was built there.
The context is this: When something is built I want to conditionally allow or disallow it. If it gets disallowed, I want to revert the condition of the tile to the state before something was built there - which also includes placing a ghost, if one was there before.
This question occoured to me here and I am interested in it because of this.
eradicator already gave me great advice, that when something was built by a robot (events on_robot_built_tile and on_robot_built_entity) there must have been a ghost of the same type there before. Naturally right?
Now I am searching for a way to answer this question for the case when a player built something manually.
How can I determine if a ghost was on a tile, when something was built there? And what kind of ghost was that?
To detail and clarify the question: I am not interested in determining if an entity or tile was built BECAUSE of a ghost. I simply want to know if a ghost was on a tile before something was built there.
The context is this: When something is built I want to conditionally allow or disallow it. If it gets disallowed, I want to revert the condition of the tile to the state before something was built there - which also includes placing a ghost, if one was there before.
This question occoured to me here and I am interested in it because of this.
eradicator already gave me great advice, that when something was built by a robot (events on_robot_built_tile and on_robot_built_entity) there must have been a ghost of the same type there before. Naturally right?

Now I am searching for a way to answer this question for the case when a player built something manually.