[SOLVED] Machine outputs more than 1 stack full

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

[SOLVED] Machine outputs more than 1 stack full

Post 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.
Last edited by DRY411S on Tue Jun 07, 2016 6:45 pm, edited 1 time in total.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Machine outputs more than 1 stack full

Post by DaveMcW »

Code: Select all

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

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: Machine outputs more than 1 stack full

Post 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

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Machine outputs more than 1 stack full

Post 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.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: Machine outputs more than 1 stack full

Post 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.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: Machine outputs more than 1 stack full

Post by DRY411S »

Fixed, but very ugly. :)
recycledrocketsilougly.PNG
recycledrocketsilougly.PNG (306.15 KiB) Viewed 2189 times

Post Reply

Return to “Modding help”