Blueprint support for control replaced entities

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Blueprint support for control replaced entities

Post by darkfrei »

Mod example: Burner Offshore Pump
Linked topic: viewtopic.php?f=25&t=77514

I have a mod, where one entity says where I can place the entity, for example offshore pump can be placed only on the water edge. After placing it will be replaced with the assembling machine, that has some recipe.

Request: by selecting this assembling machine with the blueprint, the blueprint must get the offshore pump and item for it placing.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Blueprint support for control replaced entities

Post by Klonan »

You can replace the entities with script when the blueprint is captured

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Blueprint support for control replaced entities

Post by darkfrei »

Klonan wrote:
Sun Nov 10, 2019 12:56 pm
You can replace the entities with script when the blueprint is captured
1. I don't know how, the linked topic was about it and here was no solution.
2. If it possible, it's nice to have the ready solution without script, just something like entity.blueprinted_as_entity_name = entity.name (or better name).

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Blueprint support for control replaced entities

Post by DaveMcW »

darkfrei wrote:
Sun Nov 10, 2019 4:02 pm
something like entity.blueprinted_as_entity_name = entity.name (or better name).
entity.placeable_by

But maybe it doesn't work on offshore pumps?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Blueprint support for control replaced entities

Post by eradicator »

DaveMcW wrote:
Sun Nov 10, 2019 11:23 pm
darkfrei wrote:
Sun Nov 10, 2019 4:02 pm
something like entity.blueprinted_as_entity_name = entity.name (or better name).
entity.placeable_by

But maybe it doesn't work on offshore pumps?
As far as i remember placeable_by only changes what items the bots can use to revive the ghost, not what entity ghost becomes part of the blueprint.

Better management of placement restrictions is an age old dead request of mine btw: viewtopic.php?t=54014
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.

User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

Re: Blueprint support for control replaced entities

Post by AmatorPhasma »

eradicator wrote:
Mon Nov 11, 2019 12:27 am
DaveMcW wrote:
Sun Nov 10, 2019 11:23 pm
darkfrei wrote:
Sun Nov 10, 2019 4:02 pm
something like entity.blueprinted_as_entity_name = entity.name (or better name).
entity.placeable_by

But maybe it doesn't work on offshore pumps?
As far as i remember placeable_by only changes what items the bots can use to revive the ghost, not what entity ghost becomes part of the blueprint.
Yes this works, I have also two offshore pumps (burner / electric) in fact assembling machines placed by offshore pumps, and placeable_by on the assembling-machine prototype works perfekt with blueprints and Q-hotkey.

Thanks :)

Post Reply

Return to “Modding interface requests”