Promethium Crafting Rework


Reworks crafting promethium science to yield more productivity while traveling further from the solar system edge to the shattered planet. Greater risk should provide greater reward.

Content
17 days ago
2.0
223
Manufacturing

g Fatal crash when pasting in criogenic plant

6 months ago
(updated 6 months ago)

After pasting recipe over a criogenic plant the game crash and give me this log:

Error while running event promethium-crafting-rework::on_entity_settings_pasted (ID 35)
promethium-crafting-rework/control.lua:314: attempt to index field '?' (a nil value)
stack traceback:
promethium-crafting-rework/control.lua:314: in function 'remove_beacon'
promethium-crafting-rework/control.lua:275: in function <promethium-crafting-rework/control.lua:271>
11225.052 Info AppManager.cpp:342: Deleting active scenario.
11228.413 Info HttpSharedState.cpp:55: Downloading [External Link]

6 months ago

Was this done with a blueprint?

4 months ago

sorry for responding too late, the crash occured when i copy the config info whit shift + right click, and pasted it on the criogenic plant, that instantly crashes the game

3 months ago

This is strange (sorry for long wait, I’m very busy ATM) as I thought I got all edge cases lol. I’ll have to check again. Could you give me more details about the scenario, such as what the cryo plant being pasted upon is like (what its recipe was, if any)? And also what the recipe being pasted is (if any)

a month ago

I just encountered almost this exact same error, just some line differences:

Error while running event promethium-crafting-rework::on_entity_settings_pasted (ID 38)
promethium-crafting-rework/control.lua:314: attempt to index field '?' (a nil value)
stack traceback:
promethium-crafting-rework/control.lua:314: in function 'remove_beacon'
promethium-crafting-rework/control.lua:283: in function <promethium-crafting-rework/control.lua:271>

Seems I can repeat it consistently when copying settings from one cryogenic plant to another. The cryogenic plants I have tested with are placed on Aquilo and Vulcanus. It doesn't seem to matter if they are frozen or not (happens with both frozen, both unfrozen, and one frozen the other not). I have observed it give this error seemingly regardless of recipe - ones I've tested are a parameter recipe (an option you can enable under interface settings, to show parameters in selection lists, so you can build parameterized blueprints and recipes directly), solid fuel, fluoroketone cooling, and fusion reactor, as well as explosives when tested on Vulcanus (shipped them all the way to test lol)

The parameter recipe had been copy pasted from a Foundry that came from a blueprint, and would have included logistics network connection and controls. The other recipes did not. The fluoroketone and solid fuel were a copy paste from existing plants that had done those recipes multiple times, the fusion reactor pasting had been done between two freshly placed cryogenic plants, both with no modules. Happened when pasting the fusion reactor recipe onto a totally unconfigured cryogenic plant, as well as when placing two cryogenic plants, manually selecting fusion reactor in both (with no other setting or configuration changes) and then pasting from one onto the other.

Copying a plant as a blueprint, and pasting that blueprint over an existing one to copy settings, seems to work fine, its just the shift +right and shift + left click copy paste that gives the issue.

After pasting a blueprint twice to get two identically configured cryogenic plants, shift + right click copy pasting the settings of one to the other causes the crash still.

Ghost versions of the cryogenic plants do not cause the error when settings are copy pasted, only actual ones.

The cryogenic plants I tested with are Mythic quality (from the Mythic Quality mod), and I also have Quality effects fixed using Factorio 2.0.56's new feature to make quality scale the module slots of machines. The latter is probably unrelated, though since that feature wasn't in Factorio when LeMauzer reported the issue. I also have Stable Foundations, which makes buildings placed on different concrete or stone tiers get an invisible beacon that gives a bit of crafting speed, efficiency, and productivity, all configurable. That might be related since it also does invisible beacons.

I also have Productivity Fix, which makes all recipes accept productivity (because of module limitations, the aforementioned Stable Foundations won't apply its bonuses unless all the bonuses can be applied, and that bothered me, so I made productivity work in every recipe). I don't have it configured to make beacons allow productivity or quality modules, so I don't think its that modifying the hidden beacon, especially since that already accepts productivity modules, in order to be able to work as it does.

I have quite a few other mods, but I don't think they would possibly be having an impact here - I can give more information and list more of those mods if needed, though.

a month ago

Holy detailed response. Well, I may be able to check it out this weekend. I just work really long hours so my time to mod is significantly lower now, and I haven’t done it in a while. I can’t promise anything, but the detailed response helps a lot

a month ago
(updated a month ago)

Looking at the code on that line, it looks to be mentioning storage.platforms[surface_name].beacon_cache. However, establish_variables starting on line 46 only looks to initialize that for any platform surfaces? (specifically, any surfaces that have "platform-" in their name) So it might work fine on platforms, but only crash on the ground, when it tries asking for a value in a beacon_cache for a table entry that doesn't exist in storage.platforms.

Yup, copy pasting settings on a platform works fine, so its just when doing so on a planet that it is crashing. Copy pasting from ground to a platform is fine, but copy pasting from platform to ground crashes, so its when trying to paste settings into any cryogenic plant planetside.

Could probably check if storage.platforms[surface_name] first, and only if true check for the beacon cache, I'd imagine. I'm also working at the moment though so can't test it too thoroughly at the moment.

a month ago

Was finally able to try testing if adding that if statement works, and it does look to resolve the issue. I don't know if it adds any other issues, but I don't see how it would. Here's the modified function, basically just added the if and indented the stuff after it:

-- Simply removes a beacon, and removes from the cache
function remove_beacon(entity)
local surface_name = entity.surface.name
if storage.platforms[surface_name] then
local position_key = serialize_position(entity.position)
local cached_beacon = storage.platforms[surface_name].beacon_cache[position_key]
if cached_beacon then
for _, beacon in pairs(entity.surface.find_entities_filtered{name="rework-beacon", position = entity.position}) do
beacon.destroy()
beacon = nil
storage.platforms[surface_name].beacon_cache[position_key] = nil
end
end
end
end

You should be able to just edit the remove_beacon function to that, and upload that and it should fix it. I see another of the threads here was reporting the same issue.

Anyone running into the issue can technically pop the mod open and make that change on their own end, as well, if needed in the meantime.

17 days ago

Yeah that seems to be the issue as the cryoplants are cached by what surface they are on. Nice job debugging, I'll fix it real quick

New response