Creating multiple entity-ghosts in the same location

Place to get help with not working mods / modding interface.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Creating multiple entity-ghosts in the same location

Post by Pi-C »

Does anybody know if it is possible to create entity-ghosts of the same entity on the same location -- but for different forces? The general idea (not mine, I'm collaborating on the successor of one of the mods abandoned by Ownlyme) is to make bots put out fires by dropping water canisters on them. Placing ghosts already works, but so far, the ghosts are always placed on account of the force "player". This is OK for single player games and for multiplayer games where all players are on the default force. But in PvP scenarios, bots of other forces would never build the ghost, so fires could spread without control.

I've thought of creating not one ghost per fire, but one ghost for each force per fire. If any force has bots nearby, they would drop the canisters on their own blueprint (the entities would have to have a zero-collision box, obviously), and on removing the fire, I'd remove all remaining entity-ghosts. Would that work, or would the ghost on top block the other ghosts for good? It's hard to test this, so if anybody already has tried something like that, it could save me some time. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Creating multiple entity-ghosts in the same location

Post by PFQNiet »

I have a "floor" entity in the mod I'm building. I can place its ghost in the same place as "building" entities with no issue, but I can't place another "floor" ghost there. It seems that so long as they don't collide then you can put multiple of them. `not-colliding-with-itself` may help, as that way it will still have collision so you can still use `find_entities_filtered` based on that. Especially with 1.1's upcoming expansion of layers, you can use eg. `{"layer-23","not-colliding-with-itself"}`

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Creating multiple entity-ghosts in the same location

Post by Pi-C »

PFQNiet wrote:
Thu Nov 19, 2020 6:56 am
It seems that so long as they don't collide then you can put multiple of them. `not-colliding-with-itself` may help, as that way it will still have collision so you can still use `find_entities_filtered` based on that. Especially with 1.1's upcoming expansion of layers, you can use eg. `{"layer-23","not-colliding-with-itself"}`
Thanks for the advice! I'll try that tonight …
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding help”