Large main buildings

This is the place to request new mods or give ideas about what could be done.
Post Reply
EneCtin
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jul 23, 2018 10:42 am
Contact:

Large main buildings

Post by EneCtin »

Is there a way to make the buildings larger? Most are the size of a tent or a truck. Some I'd like to see larger (refinery, steam engine, factories, etc) plus cost a fair amount to build.

I guess the object image needs to be redone, and some other file for size and connector locations.
Do you know where I could look&read (I might go tweak-ing) and if I can replace/rewrite things and the game accept those new data?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Large main buildings

Post by darkfrei »

Yes, you can make new sizes of buildings. But you must be pretty good with data.raw prototypes.
Some example with vanilla bildings scaling: https://mods.factorio.com/mod/NuclearScale
Another example with pipes connection https://mods.factorio.com/mod/AllMyFluids

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Large main buildings

Post by eradicator »

I wrote half of a generic scaling function for entities the other day. Works on base images and shadows so far, but not working visualizations, pipes etc. Maybe it'll help you understand how this works. Or maybe it's too complicated :p.

Code: Select all

function sprite .scale (layers,factor,working_visualization)
  --scales all sub-nodes of an entity's sprite tree
  --works recursively so input can be any level above what you want to change
  --i.e. can also be the entity prototype itself, or just entity.animations etc
  working_visualization = working_visualization or false
  local this = layers
  for name,layer in pairs(layers) do
    if (type(layer) == 'table') then
      if layer.filename then
        --scale
        layers[name].scale = (layers[name].scale or 1) * factor
        
        --shift factor
        local shift_factor
        if layer.draw_as_shadow or working_visualization then
          shift_factor = factor
        else
          shift_factor = factor/2
          end
        --apply shift
        layers[name].shift = erlib.point.multiply(layers[name].shift or {0,0},shift_factor) --almost correct :/
        end
      sprite .scale(layer,factor,working_visualization) --recursion through subtables
      end
    end
  end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Ideas and Requests For Mods”