Liquid science input

Place to get help with not working mods / modding interface.
AntiElitz
Filter Inserter
Filter Inserter
Posts: 536
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

Liquid science input

Post by AntiElitz »

I try to make a Lab accept a fluid as a science pack. However I cannot get it work! Is this even possible? Do you know how i can make this work?

I tried out the following, but couldn't even find any inputs, even tho there is nor error:

Code: Select all

table.insert( data.raw["lab"]["lab"].inputs, { type = fluid, name = "sulfuric-acid" } )

data.raw.lab['lab'].inputs =
    {
      "science-pack-1",
      "science-pack-2",
      "science-pack-3",
      "military-science-pack",
      "production-science-pack",
      "high-tech-science-pack",
      "space-science-pack",
    }
	
data.raw.lab['lab'].input_fluid_box =
    {
      production_type = "input-output",
      pipe_picture = assembler2pipepictures(),
      pipe_covers = pipecoverspictures(),
      base_area = 1,
      height = 2,
      base_level = -1,
      pipe_connections =
      {
        { position = {-2, 0} },
        { position = {2, 0} },
        { position = {0, 2} },
		{ position = {0, -2} },
      }
    }
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Liquid science input

Post by Choumiko »

Try

Code: Select all

data.raw.lab['lab'].inputs =
    {
      "science-pack-1",
      "science-pack-2",
      "science-pack-3",
      "military-science-pack",
      "production-science-pack",
      "high-tech-science-pack",
      "space-science-pack",
    }
table.insert( data.raw["lab"]["lab"].inputs, { type = fluid, name = "sulfuric-acid" } )
Your code overwrites the inputs with a completely new table, hnece sulfuric acid never makes it into the inputs table. I would be surprised if a lab can accept fluids though :)
AntiElitz
Filter Inserter
Filter Inserter
Posts: 536
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

Re: Liquid science input

Post by AntiElitz »

Yeah, you are right, im dump. However with the right order is still doesn´t work. It´s expecting a string. However just including sulferic-acid gives the error "is not an item" (but a fluid)
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Liquid science input

Post by steinio »

You can add a sulfuric acid barrel, if you like.
Image

Transport Belt Repair Man

View unread Posts
AntiElitz
Filter Inserter
Filter Inserter
Posts: 536
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

Re: Liquid science input

Post by AntiElitz »

I could but the acid is just a placeholder. I just want to add a different Mechanik by connecting pipes to the labs
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Liquid science input

Post by bobingabout »

I don't think you can do this because the tag inputs is looking for a list of items, specifically items. You could however make a new science pack item that costs the fluid to craft.

If you think about how recipes work though, there are two ways to define them:
{"item-name", amount}
{type = "item-type", name = "item-name", amount = "amount"}
where item-type can be "fluid" for a fluid, or "item" for ANY non-fluid item type.

This won't work with a lab for two reasons.
1. you simple have a list containing "item-name", which means you can't specify the type.
2. the item-type is specifically set to "tool" too, so not only does it not give you the option to set what type you're putting in, but is looking for a specific type.

This basically means, you can't make it use a fluid, you need a purpose made science pack, which in itself can contain a fluid.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”