Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factoriodump generates "results": [ [] ] #11

Open
abesto opened this issue Sep 5, 2019 · 2 comments
Open

factoriodump generates "results": [ [] ] #11

abesto opened this issue Sep 5, 2019 · 2 comments

Comments

@abesto
Copy link

abesto commented Sep 5, 2019

The output of factoriodump on my (heavily modded, details below) installation includes entries with "results": [ [] ] that he web UI barfs on. Looking at the rest of the JSON file, it looks like this is indeed not valid content.

Example

        "cobalt-oxide-from-copper": {
                "amount": 1,
                "name": "stone",
                "type": "item"
            }, {
                "amount": 1,
                "name": "solid-carbon",
                "type": "item"
            }, {
                "amount": 5,
                "name": "gas-hydrogen",
                "type": "fluid"
            } ],
            "localized_name": {
                "en": "Advanced copper processing with Cobalt oxide"
            },
            "main_product": "copper-plate",
            "name": "cobalt-oxide-from-copper",
            "order": "c-b[cobalt-oxide-from-copper]",
            "results": [ [], [] ],
            "subgroup": "bob-material-chemical",
            "type": "recipe"
        },

Environment

Side-note

I understand this is probably a weird edge-case that only comes up with tons of complex mods. Then again, a calculator is especially useful in such a playthrough. And who knows, maybe it's an easy fix, or highlights some other problem that was hiding so far, so thought I'd submit this anyway.

🌈

@abesto
Copy link
Author

abesto commented Sep 7, 2019

Managed to dig out the .lua source for the recipe in the example:

{
    type = "recipe",
    name = "cobalt-oxide-from-copper",
    icon = "__bobplates__/graphics/icons/copper-cobalt-oxide.png",
    icon_size = 32,
    subgroup = "bob-material-chemical",
    order = "c-b[cobalt-oxide-from-copper]",
    category = "chemical-furnace",
    energy_required = 25,
    enabled = false,
    ingredients =
    {
      {type = "item", name = "copper-ore", amount = 7},
      {type = "item", name = "stone", amount = 1},
      {type = "item", name = "carbon", amount = 1},
      {type = "fluid", name = "hydrogen", amount = 5},
    },
    results=
    {
      {type = "item", name = "copper-plate", amount_min = 7, amount_max = 11},
      {type = "item", name = "cobalt-oxide", amount_min = 1, amount_max = 3},
    },
    main_product= "copper-plate",
    allow_decomposition = false
  },

@abesto
Copy link
Author

abesto commented Sep 7, 2019

And verified with an fmt.Println that the incorrect data is already present in getJSON() after executing the Lua stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant