Transforms Json files into Factorio blueprint strings, ready to be pasted in-game.
Find a file
2025-12-22 22:59:08 +01:00
hdr switched from t_[...] type naming to standard [...]_t 2025-12-06 04:03:59 +01:00
include added executable version 2025-11-07 15:00:59 +01:00
lib switched from t_[...] type naming to standard [...]_t 2025-12-06 04:03:59 +01:00
src switched from t_[...] type naming to standard [...]_t 2025-12-06 04:03:59 +01:00
submodules updated submodules 2025-12-22 22:59:08 +01:00
.gitignore updated gitignore 2025-11-19 01:35:02 +01:00
.gitmodules initial push 2025-11-01 05:43:13 +01:00
LICENSE initial push 2025-11-01 05:43:13 +01:00
Makefile fixed executable version using useless -Bsymbolic linker flag 2025-12-22 22:39:00 +01:00
README.md added re rules 2025-11-12 22:44:47 +01:00

Factorio Json to blueprint string

Executable & dynamic library that converts a C-style string into a compressed, pastable C-style string.

This is useful for Factorio blueprint creation, as it can convert a string containing a Json Factorio blueprint item into a pastable blueprint string that can be directly imported in-game.

SETUP

Clone and go into the repository using

git clone --recurse-submodules git@github.com:Tzvet05/Factorio_Json_to_blueprint.git && cd Factorio_Json_to_blueprint/

Compile the executable using

make

Compile the library using

make lib

Makefile rules

make compiles the dependency libraries and the executable.

make lib compiles the dependency libraries and the library.

make all compiles the dependency libraries, the executable and the library.

make fclean removes everything that got compiled.

make clean removes everything that got compiled except the executable, the library and their dependency dynamic library.

make cleanblueprint removes the executable and library's object files.

make reall removes everything that got compiled and recompiles the dependency libraries, the executable and the library.

make reallblueprint removes the executable and library's object files and recompiles the executable and the library.

make re removes everything that got compiled and recompiles the dependency libraries and the executable.

make reblueprint removes the executable and library's object files and recompiles the executable.

make relib removes everything that got compiled and recompiles the dependency libraries and the library.

make relibblueprint removes the executable and library's object files and recompiles the library.

USAGE

Executable

Run the executable using ./blueprint {input} ({output})

{input} is the mandatory input file containing the text to convert. You must have reading permissions for it.

{output} is the optional output file containing the converted text. If it does not exist, the executable will create it and name it string.txt. If it already exists, you must have writing permissions for it.

Library

The compiled dynamic library is named libblueprint.so and is located at the root of the repository.

Its associated header (for function prototypes) is named libblueprint.h and is located at include/libblueprint.h.

Prototype

The prototype of the exported function is included in the libblueprint.h header file.

The file contains the following prototype :

char	*blueprint_json_to_string(const char *json);

Description :

This function converts a Json Factorio blueprint into a Factorio blueprint string

Arguments :

  • A C-style, null-terminated string (the Json Factorio blueprint item)

Return value :

  • A C-style, null-terminated string (the Factorio blueprint string)
  • A NULL pointer (if an error occured)

CREDITS

A special thanks to the contributors of :

  • zlib - Used to compress the Json blueprint object
  • base64 - Used to make the compressed Json blueprint object copyable