Quality Glassware


Graphics pack with many different flask designs for mods to use.

a month ago
2.0
1.07K
Owner:
Hornwitser
Source:
N/A
Homepage:
N/A
License:
CC BY-SA 4.0
Created:
a month ago
Latest Version:
0.1.0 (a month ago)
Factorio version:
2.0
Downloaded by:
1.07K users

Free science flask graphics pack for mods to use containing more than 200+ unique flasks variations across 22 different models of flasks. These assets were made for Colour Blind Friendly Science Packs, but any mod may use them!

This mod provides an API to get a unique flask design that doesn't collide with any other mods also using the same API with manual overrides via startup config. Here's some sample code get your own unique science flasks using this graphics pack:

Available graphics

See the gallery for images. In total there's 22 models with 275 variations, and all of the models have an empty variant along with a liquid variant for each of the 11 colors. There's cone_normal model also has a frozen variant for each of the colors.

Models
- cone_normal: Erlenmeyer flask
- cone_slim: slim Erlenmeyer flask
- cone_inverted: inverted flask
- cylinder: cylindrical bottle
- tube_one: tube
- tube_two: duo tubes
- tube_three: trio tubes
- sphere_normal: round-bottom flask
- sphere_tiny: florence flask
- sphere_double: double flask
- sphere_tubed: Schlenk flask
- sphere_hemi: hemisphere flask
- sphere_spiked: spiked flask
- hourglass: hourglass bottle
- torus: torus bottle
- klein: Klein bottle
- pyramid: pyramid bottle
- cube: cubical bottle
- triangle: triangular bottle
- triangle_alt: triangular bottle
- pentagon: pentagonal bottle
- hexagon: hexagonal bottle

Colors
- red
- green
- black
- cyan
- purple
- yellow
- white
- orange
- pink
- blue
- lime

Overriding flasks used by mods

If a mod uses the request_flask API of this mod then it's possible to override which flasks is used in the startup config. Look into the log file of the game and locate lines like this.

   1.469 Script @__quality_glassware__/data.lua:196: Quality Glassware assigned automation-science-pack=cone_normal/liquid_red
   1.469 Script @__quality_glassware__/data.lua:196: Quality Glassware assigned logistic-science-pack=cube/liquid_green

You can add a comma separated list of <id>=<model>/<variant> to the Quality Glassware Overrides startup setting to change them. For example setting it to automation-science-pack=tube_one/liquid_blue,logistic-science-pack=tube_one/liquid_red turns automation and logistic science into blue and red tubes.

Example code

local meld = require("meld")

-- Main method to get a flask design from Quality Glassware to use in your mod
local flask = quality_glassware.request_flask(
    -- Unique identifier for what this flask is used for. This is used to allow overriding it in the config.
    "super-science-pack",
    {
        -- Prefer a round flask with blue liquid inside
        { model = "sphere_normal", variant = "liquid_blue" },
        -- If that's taken use the first flask shape found with blue liquid that's available.
        { variant = "liquid_blue" },
    }
)

-- Example prototypes for a new science pack
local super_technology = {
    type = "technology",
    name = "super-science-pack",
    unit = {
        time = 30,
        count = 10,
        ingredients = {{"automation-science-pack", 1}},
    },
}

local super_science_pack = {
    type = "tool",
    name = "super-science-pack",
    stack_size = 100,
    durability = 1,
}

-- Add the icon and icon_size properties to the prototypes, this sets icon, and icon_size and removes icons.
meld(super_technology, quality_glassware.technology_graphics_for(flask, meld))
-- You can also omit meld to get an icon layer suitable for composing.
super_science_pack.icons = {
    quality_glassware.item_graphics_for(flask),
    {
        icon = "__core__/graphics/add-icon-white.png",
        icon_size = 32,
        shift = { 8, 8 },
        scale = 0.25,
    }
}

-- Add the prototypes to the game
data:extend({super_science_pack, super_technology})

-- Tell the lab it can consume this science pack
local lab_inputs = data.raw.lab.lab.inputs
lab_inputs[#lab_inputs + 1] = "super-science-pack"

For more information about the API check out the source code.