Ghost entity placement event?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Omnifarious
Filter Inserter
Filter Inserter
Posts: 267
Joined: Wed Jul 26, 2017 3:24 pm
Contact:

Ghost entity placement event?

Post by Omnifarious »

There is an event for when the player (not a bot) builds an entity. Is there a way to detect when a player places a ghost? Not a blueprint, but a single entity ghost. My LD Circuit mod automatically adds circuit wires when the player places a long-distance power pole with a small supply range. I would like to be able to do this on ghost placement as well.

Thank you in advance (and likely afterwards too). :-)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Ghost entity placement event?

Post by boskid »

Ghosts are just another type of Entity so all the standard events should apply. When you build a ghost of electric pole you will get `on_built_entity` event with created_entity pointing to the entity-ghost for which ghost_name=<pole name>.

User avatar
Omnifarious
Filter Inserter
Filter Inserter
Posts: 267
Joined: Wed Jul 26, 2017 3:24 pm
Contact:

Re: Ghost entity placement event?

Post by Omnifarious »

boskid wrote:
Mon Jan 04, 2021 9:24 am
Ghosts are just another type of Entity so all the standard events should apply. When you build a ghost of electric pole you will get `on_built_entity` event with created_entity pointing to the entity-ghost for which ghost_name=<pole name>.
Oh, nifty! Thank you. That definitely solves my problem.

Post Reply

Return to “Modding help”