No More Gambling


4 Quality Tier 1 modules now give you a full +100% Quality chance. But also +900% Crafting Cost.

Overhaul
7 months ago
2.0
3.28K
Factorio: Space Age Icon Space Age Mod
Manufacturing

b ✔ Pipette does not work after module insertion

8 months ago

Good day! I just got to the point where I am expanding quality production, and really like the cost vs quality tradeoff for more consistent upgrades.

However, I notice that as soon as I insert a quality module, the pipette (default Q, IIRC) will no longer pick up buildings. When the quality module is removed, the pipette works again.
While I have not worked deeply with Factorio modding APIs, I notice the recipe changes when the quality module is inserted, e.g. from Exoskeleton (a recognized factoriopedia entry) to Unknown key: entity-name.exoskeleton-equipment (Recipe).
Similarly, copy and paste does not work, whether using Ctrl-C/V for the whole building or the right mouse click on one factory -> left mouse click on another.

Perhaps the altering of the recipe somehow is resulting in this behavior? I do have a fair few other mods installed but none should interfere with this one, based off my (rather uninformed) experience. Let me know if I can provide any other information or mod list/save file!

8 months ago

Yes, recipes are different based on how many modules are inserted.

Setting copy and paste could possibly be overridden via script so it always uses the appropriate recipe.

Not sure if the pipette behavior can be changed. I have always been more of a Ctrl+C, Ctrl+V player so I didn't really run into it in my own playtesting.

8 months ago

Hm, weirdly, when I try to use Ctrl+C, it also is not able to copy the building. I lasso the building, but nothing is copied to clipboard nor does the blueprint get created in the cursor.
The only mod the building shows for me is this one, so not sure why this isn't working. The logfile only shows output when the quality modules are added or removed from buildings, nothing when I attempt to use the pipette or copy/paste operations.
Is there a debug mode I could enable somehow, to figure out what the conflict/issue is?

8 months ago

Hmm... that sounds like some other mod is removing the "placeable_by" property of the entities, which is necessary for the blueprints/clipboard to work.

8 months ago

Well I went through my mod list, both in sections as well as disabling everything except this one (and Space Age/Elevated Rails/Quality DLCs) , and no combination of disabling other mods was able to restore the copy behaviors.....very weird.
I am using the latest Factorio version, v2.0.28.

Also the copying exclusively breaks when a quality module is inserted, so I wonder if for whatever reason the crafting machine variants aren't getting populated for me, or something like that?

8 months ago
(updated 8 months ago)

I've been able to get this to work by adding a small tweak in this if block
The repository seems to be set to read-only so can't submit a PR, but if you add:

elseif cpy.placeable_by == nil then
    cpy.placeable_by = {{item = entity.name, count = 1}}

after that line, it covers whatever is happening with my game. Still no clue which mod is resulting in that being nil at the prototype stage , though, as the items_to_place runtime property is set on the base machine prototype as you would expect.

8 months ago
(updated 8 months ago)

Ah. I had something like this in a older version of the mod, but instead used the mineable.result because some mods have entities that don't have a item of the same name as the entity and then the game fails to load.

Basically the flow at that code block is like this:
-- If the entity has a single placeable_by then turn that into an array.
-- If the entity has a mineable result, add the mineable result to the placeable_by array.

I guess I could add the entity.name if the entity has no mineable result, as long I ensure that a item with that name actually exists.

Alternative, but maybe more stable would be to actually parse through all items and find all items that build the base entity, then add all found. Mineable could be pretty much anything, as could the entity name, it just happens to work with Vanilla entities that way.

8 months ago

Implemented the more robust placeable_by version.

Also added custom handling for copy & pasting settings between assemblers with different amount of quality modules.

8 months ago

Ahhh awesome, thank you for such a detailed explanation!! (As an aside, the mineable result was also showing as empty for me at this stage, so seems like whatever is clearing it out for me is doing a thorough job)

I just checked the updated version and looks like that resolved the issue - thanks so much for being so responsive, really appreciate it!

New response