blueprint string in scripts

Things that already exist in the current mod API
Post Reply
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

blueprint string in scripts

Post by mophydeen »

I'd like an easy api way to use blueprint strings in scripts.

eg. add a blueprint book to the "game blueprints"-frame in script.

Code: Select all

game.blueprints.add("somestring")

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: blueprint string in scripts

Post by Killkrog »

I second that.
Also please give us an option to read from the library.



mrvn
Smart Inserter
Smart Inserter
Posts: 5696
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: blueprint string in scripts

Post by mrvn »

Might be related to this feature request:

In factorissimo it would be great if a factory building included in a blueprint would include a blueprint for everything inside the factory building. On placement it should then also place a blueprint inside the factory building to create the contents.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: blueprint string in scripts

Post by Bilka »

What exactly is the request here? Do you want to access the blueprint library, or do you want to convert blueprints from/to strings?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5696
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: blueprint string in scripts

Post by mrvn »

Bilka wrote:
Sat Sep 29, 2018 7:29 pm
What exactly is the request here? Do you want to access the blueprint library, or do you want to convert blueprints from/to strings?
Convert from/to strings.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: blueprint string in scripts

Post by Bilka »

mrvn wrote:
Mon Oct 08, 2018 10:40 am
Bilka wrote:
Sat Sep 29, 2018 7:29 pm
What exactly is the request here? Do you want to access the blueprint library, or do you want to convert blueprints from/to strings?
Convert from/to strings.
This is already possible through https://lua-api.factorio.com/latest/Lua ... port_stack and https://lua-api.factorio.com/latest/Lua ... port_stack.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: blueprint string in scripts

Post by eradicator »

Regrettably that requires a stack, so it's impractical to use when all you want is the list of entities/settings. I think 0.17 was going to have a decoding operation blueprint_string → blueprint_table?
Along that line it would be kinda neat to have the option to build a blueprint without a stack...or: How realistic would it be to allow lua scripts to create stacks that don't exist in the world, just to be manipulated via script for things like this?
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
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: blueprint string in scripts

Post by Killkrog »

Bilka wrote:
Sat Sep 29, 2018 7:29 pm
What exactly is the request here? Do you want to access the blueprint library, or do you want to convert blueprints from/to strings?
I'd love to be able to access the blueprint library via API, as I already described in detail here. Noone ever bothered to answer though...

Post Reply

Return to “Already exists”