Mini Machines Mod

by Kryzeth

Miniature versions of assemblers, electric furnaces, etc. Full integration with all of Bobs mods and ShinyBobGFX/ShinyAngelGFX, Industrial Revolution, Factorio Extended Plus (FXP), Gotlag's Electric Furnaces, AAI Industry, Fantario, and One More Tier. (independently, not necessarily simultaneously)

Content
a day ago
0.13 - 2.0
11.7K
Manufacturing

i I want the opposite of this

7 years ago

I was hoping to be able to modify the terrain generation to have more water than what you get with the highest water settings so it would be impossible to build a regular main bus. That seems to be impossible without completely overriding the terrain generation. So if I can't make the land smaller then I have to make the buildings bigger. So I want to increase the size of assemblers and chemical plants to 5x5 and furnaces to 4x4. I understand the basic concept of how to mod it but your code is over my head. I can't even find in the base mod where assemblers are defined. I was hoping I could talk you into doing all the work for me, but failing that perhaps you can get me going in the right direction. I imagine that actually changing the base assemblers would be bad, because it would at the very least break any blueprints with them. So maybe just make the regular machines not available until a late tech or something like that?

7 years ago
(updated 7 years ago)

LOL oh, at this point, it would not be easy to read my code. As of v4.0.0, I changed everything from hard-coded values that you would find in mods with brand new, original buildings, to completely automatic "copy from base, change values as needed, insert to game, change other values as needed by settings"

Using the functions that I have defined (in func.lua) it shouldn't be too difficult to change it to make them bigger, instead of smaller. 90% of what you will need is in data-final-fixes.lua and func.lua

copyItem takes an existing item and changes the ordering to come directly after the original
copyRecipe takes an existing recipe and either modifies the ingredients to 2/3 of the original cost, or does nothing, if a setting is disabled.
copyAssembler, copyFurnace and copyRefinery, are the functions that you would have to change the most. These copy an existing entity, and make changes to define hitbox and sprite size. They're each defined a bit differently internally, so they all require different changes done to them. The collision_box, selection_box, animations (and maybe the corpse) are all you should need to change to make them bigger. Anything that uses 0.66 should be changed to either 1.33 (3 * 1.33~=4) or 1.66 (3 * 1.66~=5).

The collision/selection boxes are the only thing I have hardcoded, so this might be the harder thing to change. I would try to find any modded or vanilla object that is the dimensions you need, and copy those values. The only other function you should need besides that is shrink (which will make a value grow, if given a value greater than 1; used in the entity copies). Every other function is for bobs compatibility, balance changes, and to copy technologies for mini machines tech tree.

I would recommend you to try making it yourself first, but if there's an issue, I can see about helping, or making it myself, if issues are too great. I do know my code best, and it might just be messy to anyone else

7 years ago

I really appreciate the response. My limited coding skills have about 15 years of rust on them and I don't know the lua syntax so it's an uphill climb. It wouldn't be a bad thing to shake the rust off, though I suppose I'd have to stop playing Factorio for a while to do it. That's probably the hardest part ;)

7 years ago

May have found a bug with your code unless I'm missing something. Disabling the tech tree is supposed to make the machines just show up at the same time as the regular version, right? They don't show up at all for me. I tried both with loading a saved game with all the techs already researched and starting a new game and researching automation only gave me the regular assembler 1. I don't see anything in the techtree.lua that would add them to those techs if tech == false but I figured I just didn't understand something. Which may still be the case.

Also this is a minor thing but your function shrink() is passed the percentage as an argument but ignores it and uses a hardcoded value.

I have made some progress. I'm able to get it to place an assembling machine of variable size (odd only) based on a startup setting with the correct selection and collision boxes. Now I just have to apply what you did to the chemical plant and other furnaces, while understanding less than half of it :)

7 years ago

Hmm, so it does. I basically recreated the mod from scratch, although for the tech tree, I used a lot of the same overall logic. I forgot to copy over the after block

LOL ah, so it does. I forgot to change that to use percent

As for the chemical plant and furnace.. you can take a peek at the base's actual entity definitions, under steam > steamapps > common > factorio > data > base > prototypes > entity ; should be either entities.lua or demo-entities.lua

7 years ago

One more little bug for you. Your function copyFurnace does not adjust the scale of the working animation for the regular graphics. You need anim.animation.scale = 0.66 around line 130. You can thank my ancient graphics card for that one. Now that I've actually peeked at the high res setting and how good it still looks even scaled up I think its days are numbered.

I haven't done the chemical plants yet, but with the assemblers and furnaces done it's playable so I'm doing a playthrough to see how it goes. It's so weird. Everything you thought you knew about placing power poles is wrong :) I thought I might have to modify the power poles to have more reach but at least at my current settings it actually works out fine. I'd be happy to send you the alpha version if you are interested, though the guy that made mini machines is probably not the right guy for this mod ;)

7 years ago
(updated 7 years ago)

Ooh, hadn't noticed that. Will fix for the next update, thanks! As for this mega machines mod you have, I wouldn't mind taking a look X3 Might be fun to see how cluttered the crafting menu can get with both enabled :D

7 years ago

Send me an email to legend65 at yahoo dot com and I'll send it to you, or is there some other way you want it?

The crafting menu should look the same since I disable the regular ones. They do show up when you set a filter though. I think you can set a property to hide them from there but haven't gotten that far yet.

New response