[0.18.36] Empty blueprint books give malformed value when I "Export to string"

This subforum contains all the issues which we already resolved.
jeff.s
Inserter
Inserter
Posts: 22
Joined: Thu Jan 10, 2019 10:49 pm
Contact:

[0.18.36] Empty blueprint books give malformed value when I "Export to string"

Post by jeff.s »

Vanilla, 0.18.36, no mods, tried on both MacOS and Windows builds.

This is admittedly a minor issue, and it's possible the upcoming changes to blueprints talked about in FFF-356 will render this obsolete, but here we go:

It seems that at least one other user "in the wild" has run into this. Searching for the malformed blueprint string (from steps to reproduce) on Google finds a Pastebin, as well this forum post which Google suggests is Japanese for roughly "When I try to import an empty construction plan book, I get an error."
Steps to Reproduce:
1. Create a new empty blueprint book, and give it a name. Export that blueprint book to a string and you get

Code: Select all

0eNqrrgUAAXUA+Q==
which is just an empty JSON object,

Code: Select all

{}
2. Import this blueprint string, and the game console prints "Error while importing string: Input produced no item". There is no crash, the game is still running fine and I can import other valid blueprints.

If you place an empty blueprint into the blueprint book (e.g. copy something and remove all the entities from the blueprint), and then export the blueprint book, you'll get the same blueprint string.
Sanity Check:
Just to check that I don't have some weird bug with blueprints, I placed a NON empty blueprint (one furnace, one tile etc) into the blueprint book, and exported the blueprint book to a string, and I do get a reasonable result, such as:

Code: Select all

0eNqdkcFugzAMhl9l8jlU0HZD4rbb3mGaUKBuZTU4KDFoqMq7LwFVcOgO7c3+nf/74+QGjRmwd8RSN9Zeobqtiofqe9OmGbWWF9nThbVJmkw9QgUjORmiooB1l4TlRPYFQQHxCX+hKoJ6wvm5ce6fcm4zDy9nHsOPAmQhIVyWnpup5qFr0MV1VrdYxuw8ONYtRmhvfXRZTomRlOW7dwXTUoSEJcEu+tbHVWB0gyaxejqhE2f5zXdohPgSpyM6PwPL8lAUZZl/7I/rVfNHzGz+0Yfgs27FuikOY0Ej1nfOP0HhD3OtuFk=
Which can be re-imported and produces the expected blueprint book with one blueprint in it.
Expected Behavior:
When exporting a blueprint book containing no blueprints or empty blueprints, I shouldn't end up with a blueprint string that can't also be imported back into the game.
Discussion:
The two options I can think of if you did fix this would be to either tell me I can't export an empty blueprint book, or make it so that empty blueprint books still export something reasonable. Maybe there are other ways to handle this that I can't think of, and I don't know enough to weigh implementation cost/complexity against user experience if you were to try to fix it.

I will say that by cutting out all the actual entries in the blueprints array, I can manually construct a blueprint string that imports correctly and yields an empty blueprint book with the given name. This is the JSON:

Code: Select all

{
  "blueprint_book": {
    "blueprints": [],
    "item": "blueprint-book",
    "label": "room to expand",
    "active_index": 0,
    "version": 77311770624
  }
}
and this is it encoded as a blueprint string:

Code: Select all

0eNpFykEKgzAQRuGryL+OEFsxMFcpRZI6i8EkIzEVQbx7pRu373sHQvzyUiTXMajOoOMuK+j1NpDKCXTn9j8aRB84XlBUU1O14X3xebrAf6psPEqeeAdZg43LKppBzj27zjk7PPrz/AHC9Soe
Cheers!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14408
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.36] Empty blueprint books give malformed value when I "Export to string"

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
jeff.s
Inserter
Inserter
Posts: 22
Joined: Thu Jan 10, 2019 10:49 pm
Contact:

Re: [0.18.36] Empty blueprint books give malformed value when I "Export to string"

Post by jeff.s »

Cheers, thanks!
Post Reply

Return to “Resolved Problems and Bugs”