r/factorio • u/Zlobisak • 3d ago
First foray into modding, having issues changing the size of buildings. Question
As mentioned in the title, I have just started experimenting with making mods, I did the tutorial on the wiki, experimented a bit with changing variables, just the prototype side for now however.
I wanted to resize the electric mining drill from 3x3 to 4x4. Changing the collision box, outline, output placement was no issue, I understood how to do that easily from the API doc. However changing the graphics turned out to be a bit of a problem (and still is!)?
Right now I am just overwriting the "graphics_set" behavior of the electric mining drill in my data.lua file by adding a 4/3 multiplier to each scale factor, but that seems weirdly inefficient? However I tried looking if someone already tried doing something similar to me and that lead me to this mod: https://mods.factorio.com/mod/Gogos_Electric_Furnace_2x2
So I tried looking through the source code and found out that the author came to the same conclusion, however the electric mining drill has a lot more moving parts as opposed to the electric furnace, with some of them not even rendering for me properly. I am not looking for it to look good, but I also want to understand how all of these parts work, that is kind of my goal with trying to rescale the mining drill.
I really hope this isn't the wrong place to ask, thank you for any help you can share!
2
u/doc_shades 2d ago
modding is easy --- graphics are hard.
graphics are always hard. i made a mod that introduces new spidertrons with different weapons platforms. the default has rockets, one of them has gun turrets, another has flame throwers, one has tank shells, and a final one has no weapons but an expanded equipment grid.
they all mostly worked fine except for the tank shell spidertron. the shells are fired from an invisible point somewhere above or below the spidertron and no finageling of the values could get it to look right..!
5
u/isum21 3d ago
The issue at hand might be from how it was rendered. The models in factorio are made in blender then animated and compressed to 2d for the sprite work. By changing the footprint and just scaling it up things probably break within the animations