dennisfokker / Factorio-Json-Calculator-Exporter-mod

Simple Factorio exporter mod which I use for my calculator.
2 stars 0 forks source link

Output to data-scripts folder #1

Closed necrogami closed 3 years ago

necrogami commented 3 years ago

Can this maybe output a file to the data-scripts folder instead of outputing inline to the log file?

dennisfokker commented 3 years ago

Short answer: Sadly I cannot. Long answer: For the calculator I want to make, I need icon data from e.g. items (file paths). This data is only available during the data stage (loading screen when you start up Factorio). During this stage (as far as I know) I can only write to the log or stdout (console) and not to custom files.

If you have a text editor which supports Regex you can use the following regex to extract the JSON object. It will be contained in group 1. \@__JsonCalculatorExporter__\/data-final-fixes\.lua\:\d+\: ({.+})\n\r?\s+\d+\.\d+ \w