- Create a blueprint from a text file or string input
- Persistent settings that allow you to adjust:
- Text plate material
- Text plate size
- Line spacing
- Text direction
- Max line length
- Blueprint name
- Register a global command for generating blueprints from and to anywhere on your system
- Decode any arbitrary blueprint to a JSON file
- Write your own code to manipulate blueprints with the provided functions and types
- Install Node.js and npm if you haven't already.
- Clone or download and extract the repository (green button at the top of the page).
- Open a terminal in the project directory (where the
package.jsonfile is) and run the commandnpm i - Run
npm startin the same directory to show the interactive prompt.
Or:
Register the global commandstextplategenandtpgenby running the commandnpm run globalin the project directory.
Or:
Execute one of thestartfiles in the project directory.start.cmdorstart.ps1for Windows,start.shfor Linux and Mac.
Note
You can also substitute the npm command with pnpm or yarn if you prefer those package managers.
- Create a file (
input.txtby default) in the directory you're starting the program from and write your text in it.
You can use all special characters that are defined insrc/characters.json - Run
npm startortextplategenor execute one of thestartfiles to show the interactive prompt. - Select
Configure the settingsto adjust the generation settings to your liking, then go back to the main menu. - Select
Create text plate blueprint from a fileto generate a blueprint from a text file.
You can also selectCreate text plate blueprint from a stringto input the text directly via the terminal. - Choose
Copy to clipboardorSave to a fileto export the blueprint.
- You can edit the file
src/characters.jsonto adjust which characters in the input text are converted to which text plate variant.
Make sure to only add or modify thereplacementsproperty and leave everything else untouched. - You can register custom aliases for
textplategenby editingbininpackage.jsonand runningnpm run globalagain. - If you set the max line length setting to any value above 0, the program will automatically split the text into multiple lines if it exceeds the specified length.
By default, your line breaks in the input text will be replaced with spaces and then new line breaks will be added wherever the line limit is reached. Change the settingPreserve Line Breakstotrueto keep the original line breaks. - There are shortcuts that will automatically select an option in the main menu and skip some extra confirmations automatically.
Usetextplategen <shortcut>(ortpgen <shortcut>) with any of the following case-insensitive values:createfromfile|createfile|file|fcreatefromstring|createstring|string|sdecodefile|dfdecodestring|dssettings|configuration|config|cfg|c
- After running the program once, a
factorio-text-plate-genfolder will be created in your appdata directory, where settings files will be stored.
Delete this folder to reset everything to the default.
The locations of this folder are:- Windows:
C:\Users\<USER>\AppData\Roaming\factorio-text-plate-gen\ - Linux:
/home/<USER>/.config/factorio-text-plate-gen/ - Mac:
/Users/<USER>/Library/Application Support/factorio-text-plate-gen/ - Custom: if the environment variable
APPDATAis set on every launch, the path will be<APPDATA>/factorio-text-plate-gen/
- Windows:
- If you are interested in the blueprint object structure or want to extend it, check out the file
src/types.tswhich contains all TS types. - If you know TypeScript, you can create a
test.tsfile in the same directory as thepackage.jsonfile and run it withnpm run testto write your own code to generate text plates or encode and decode any blueprint string in various ways.
You can also use the VS Code debugger to debug your code. Select the profiletest.ts, set breakpoints and then press F5 to start debugging your code.
Created with ❤️ by Sv443
Licensed under the MIT License
