Page 1 of 1

[SOLVED] Machine outputs more than 1 stack full

Posted: Mon Jun 06, 2016 6:55 pm
by DRY411S
In my recycling mod under development, some of the reverse recipes produce more than 1 stack worth of a result. The worst case example, my recipe to recycle a rocket-silo, with 100% of the original inputs produced as output...

Code: Select all

  {
    category = "recycling-3",
    name = "dry411srev-rocket-silo",
    ingredients = {      {        "rocket-silo",        1      }    }
    main_product = "",
    results = {
      {        amount = 1000,        name = "steel-plate"      } 
      {        amount = 1000,        name = "concrete"      }
      {        amount = 100,        name = "pipe"      } 
      {        amount = 200,        name = "processing-unit"      }
      {        amount = 200,        name = "electric-engine-unit"      } 
    }
    enabled = false,
    group = "dry411srev-combat",
    subgroup = "dry411srev-defensive-structure",
    order = "e[rocket-silo]",
    hidden = false,
    icon = "__base__/graphics/icons/rocket-silo.png",
    type = "recipe"
  }
As you see, several of the results are greater than the stack size for that type. This has the very undesirable effect that putting a rocket-silo into the machine, NOTHING comes out and the silo is lost. :(

Before I start trying to fix this, can anybody recommend any strategies to try to make the machine stop when any of the stacks have reached their limit.

Re: Machine outputs more than 1 stack full

Posted: Mon Jun 06, 2016 7:38 pm
by DaveMcW

Code: Select all

{ amount = math.min(1000, data.raw.item["steel-plate"].stack_size),   name = "steel-plate" }

Re: Machine outputs more than 1 stack full

Posted: Mon Jun 06, 2016 7:58 pm
by DRY411S
DaveMcW wrote:

Code: Select all

{ amount = math.min(1000, data.raw.item["steel-plate"].stack_size),   name = "steel-plate" }
Thanks, I appreciate that I can 'lose' a lot of the results like this, but I was thinking more along the lines of forcing the machine to do X cycles of stack_size steel-plates where X = 1000/stack_size

Re: Machine outputs more than 1 stack full

Posted: Mon Jun 06, 2016 11:37 pm
by Arch666Angel
I don't know if it works, but you could try to instead of having 1k plates as result, put 5 times 200 plates into the table, maybe the game will split them between the slots then. But that's just a wild guess.

Re: Machine outputs more than 1 stack full

Posted: Tue Jun 07, 2016 5:52 am
by DRY411S
Arch666Angel wrote:I don't know if it works, but you could try to instead of having 1k plates as result, put 5 times 200 plates into the table, maybe the game will split them between the slots then. But that's just a wild guess.
That is accepted by the game, but...
  1. the result in the machines crafting screen is far from ideal
  2. when the machine completes, the game doesn't spilt the output between the stacks, and still no output is produced. :(
Bad result
Limiting the results to a single stack of each does work.
Good result
I'd really prefer to do something where the machine stops when any of the stacks are full, like a furnace does.

EDIT: Lookes like the first screen has an error. There should be 2 stacks for pipes, not one.

Re: Machine outputs more than 1 stack full

Posted: Tue Jun 07, 2016 6:45 pm
by DRY411S
Fixed, but very ugly. :)
recycledrocketsilougly.PNG
recycledrocketsilougly.PNG (306.15 KiB) Viewed 2653 times