Modern Art Library


A library to allow other mods to place images and videos around the factory. Easily add content, customize thumbnails, change recipes, and add sound effects!

Content
11 days ago
2.0
28
Owner:
dmikalova
Source:
https://github.com/dmikalova/factorio...
Homepage:
https://github.com/dmikalova/factorio-mods
License:
MIT
Created:
15 days ago
Latest Version:
2.0.13 (11 days ago)
Factorio version:
2.0
Downloaded by:
28 users

Modern Art Library lets you make mods to place images and videos around the factory.

Based on Modern Art which was inspired by YourImage, this mod makes it easy to make more mod packs of true modern art.

Creating your own Modern Art Packs

See Modern Art: Mangione Pack for an example. You can download that mod, edit it to your liking, and upload it to the mod portal.

In detail:

  • Create an info.json file with your information, and add this lib as a dependency.
  • Create a data.lua and import the load function from this lib:
local load = require("__mklv-modern-art-lib__.load")

load({
  imagepath = "__mklv-modern-art-mangione__/graphics/images/",
  images = { ... },
  animpath = "__mklv-modern-art-mangione__/graphics/animations/",
  animations = { ... },
})
  • Fill out the images and animations sections. See load.lua for more options:
images = {
  {
  ingredients = { { type = "item", name = "iron-plate", amount = 1 } },
  localised_description = "Example description.",
  localised_name = "Example Name",
  name = "example-name",
  scale = 1,
  size = { 256, 256 },
  },
}
animations = {
  {
    localised_name = "Example Name",
    name = "example-name",
    size = {256, 256},
    framerate = 25,
    frame_count = 50,
    files = 10,
    width_in_frames = 5,
    height_in_frames = 5,
    scale = 1,
  },
}
  • Add your images and animations to the graphics/images folder - by default the images follow the naming format of $NAME.png and animations $NAME/1.png with each frame counting up from 1. See .scripts/convert-png.sh for a script to convert all your images to png and build-animation.sh to extract animation frames.
  • Add a 256x256 icon for each image to the graphics/images folder - by default the icons follow the naming format of $NAME-icon.png.
  • The mod should now be ready. You can add it to your Factorio mod directory to test it out, share it with friends, and upload it to the mod portal.

Limitations

Images and videos are limited to 4096x4096 total pixels. I think you can change the aspect ratio but not the total amount.

255 frames in an animation. If anyone has ideas on how to bypass this I'm interested.

Keeping audio synced with video seems impossible. The "persistent" option keeps it running even if you deconstruct the object and desyncs within a few loops. Making it the build sound works the first time but doesn't loop.