Event(s) when a manually placed entity replaces a ghost

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Event(s) when a manually placed entity replaces a ghost

Post by sparr »

I want to detect when an entity is being placed that will destroy a ghost, and get info about the ghost before it disappears. Either of these two events would be useful, or some other equivalent functionality:

on_ghost_removed would let me save the info about the ghost as it was being removed, before the new entity's on_built_entity fired. this event would also be useful when the player manually right clicks a ghost.

on_pre_built_entity would let me search the area for existing entities, including entity-ghost. this event would also be useful for a lot of other mods that affect building of things.

Use case: I am trying to write a mod that lets players manually place entities on top of matching ghosts and get all the ghost's settings/orientation/etc copied to the new entity.
Post Reply

Return to “Modding interface requests”