Amator Phasma's Coal & Steam (forked)

by ldinc

This mod revisits the early game of Factorio and pushes the electrification a bit further back by extending the Burner-Stage and inserting a new stage: Steam-Stage (buildings will be powered by steam).

Content
17 hours ago
1.1 - 2.0
1.18K

b [Backlog] Compatibility Patches Angel's and AAI Industries broken

1 year, 11 months ago
(updated 1 year, 11 months ago)

Hello,
whenever I load the angels mods with patch compatibility, I get this error:

Error ModManager.cpp:1558: Error in assignID: recipe-category with name 'ore-sorting-t1' does not exist.

After choosing to disable the listed "causing" mods I get this error:

3.708 Loading mod angelspetrochem 0.9.22 (data-final-fixes.lua)
   3.732 Error ModManager.cpp:1558: Failed to load mod "angelspetrochem": __angelsrefining__/prototypes/recipe-builder.lua:217: attempt to compare number with nil
stack traceback:
    __angelsrefining__/prototypes/recipe-builder.lua:217: in function 'add'
    __angelsrefining__/prototypes/recipe-builder.lua:429: in function 'p_merge_item_lists'
    __angelsrefining__/prototypes/recipe-builder.lua:509: in function 'p_result_merge'
    __angelsrefining__/prototypes/recipe-builder.lua:546: in function 'p_copy'
    __angelsrefining__/prototypes/recipe-builder.lua:567: in function 'patch'
    __angelsrefining__/prototypes/override-functions.lua:968: in function 'execute'
    ...gelspetrochem__/prototypes/petrochem-global-override.lua:24: in main chunk
    [C]: in function 'require'
    __angelspetrochem__/data-final-fixes.lua:1: in main chunk
   3.733 Loading mod core 0.0.0 (data.lua)
   3.880 Checksum for core: 3744854889
   3.942 Error ModManager.cpp:1558: Error in assignID: recipe-category with name 'crafting' does not exist.

With the Earendel's compatiblity patch and AAI Industries I get this error:

Loading mod apm_power_ldinc 0.23.6 (data-final-fixes.lua)
   2.725 Error ModManager.cpp:1558: Failed to load mod "apm_power_ldinc": __apm_lib_ldinc__/lib/utils/patch/aai.lua:10: attempt to index field 'vehicle-fuel' (a nil value)
stack traceback:
    __apm_lib_ldinc__/lib/utils/patch/aai.lua:10: in function 'generate_vehicle_fuel'
    __apm_power_ldinc__/prototypes/integrations/fuel.lua:96: in main chunk
    [C]: in function 'require'
    __apm_power_ldinc__/data-final-fixes.lua:1: in main chunk
   2.726 Loading mod core 0.0.0 (data.lua)
   2.819 Checksum for core: 3744854889
   2.879 Error ModManager.cpp:1558: Error in assignID: recipe-category with name 'crafting' does not exist.

Seems like the compatibility patches for both mod groups are currently broken and need to be revised. Also they are needed, because they prevent deadlocks like with Steel production. I tried it for the other amator mods and they have similar problems. I will write bug reports for the seperate mod though. I hope this can be resolved, because I like this mod group very much and I am happy to see someone actually maintaining them.

Thank you.

1 year, 11 months ago
(updated 1 year, 11 months ago)

Just as an addenum, the AAI Industry bug is the same as it was in this fork here:
https://mods.factorio.com/mod/apm-power-notnotmelon/discussion/5f68df9b3ff7e881ca95ea1a
But this got fixed by the forker along with potentially other bugfixes (before the deprecation). I guess you forked it from the original mod author and not from notnotmelon ? I think it's worth to take a look at this fork.
There are seemingly more bugs to this (?) according to the latest discussion here, but I am not really sure for this one.
Also notnotmelon forked the library and nuclear aswell, but I don't think there were any bug-related changes made.

1 year, 11 months ago
(updated 1 year, 10 months ago)

Sorry for the multiple posts in advance. Also sorry for the incoming wall of text.
This section is about fixing the compatibility issue with Angel's. The AAI Industry compatibility problem is only caused by the amator library (which I already opened a discussion about how to fix them).

The first bug I posted here is an issue about recipe categories. Angel's renamed and removed some of them, which causes this bug here. To fix this, open this file:

__apm_power_ldinc__/prototypes/integrations/recipe-categories.lua

And at line 99 - 101 you will see this:

    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_0', 'ore-sorting-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_1', 'ore-sorting-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-sorting-t1')

You need to replace them with this:

    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_0', 'ore-refining-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_1', 'ore-refining-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-refining-t1')

After looking through angels code, I simply looked for items, that were also category "ore-sorting-t1". This included the crushed ores and crushed stones, aswell as the ore crusher, before they got changed to "ore-refining-t1". So this change should make sense, because the apm crusher should replace the angels crusher's functionality.
I didn't encounter second bug in this post anymore, which was something with the angels petrochem, so I guess we can ignore that for now.

The next bug is the same as the second post I posted in this discussion here. This was contributed by notnotmelon. To fix this, I suggest to go to the file:

__apm_power_ldinc__/prototypes/integrations/updates.lua

Scrolling to the end of the file, copy and paste this code in:

-- angels ---------------------------------------------------------------------
--
--
-- ----------------------------------------------------------------------------
if mods.angelsrefining then
    data.raw['assembling-machine']['burner-ore-crusher'].next_upgrade = nil
end

This should incorporate all fixes done by notnotmelon up until the latest fork. I didn't figure out, what the change in the latest fork was. I guess it was just a change in the "info.json" file, but I am not really sure.

(The following section is just speculation, so ignore it if you want.)
Normally this bug fix was included in the "data-update.lua", where some of angels compatibilty patch code was. On first glance, this code was redundant, because it "changed" the first wood production result in the "greenhouse.lua". "Changed", because the changed result number was the same as before (namely 14). So the redundant code got removed and the wood results in "greenhouse" got adjusted, so they don't have two wood results, with the second one being a random count between 1 and 6. But at this stage, I am not sure, if it was really redundant code. Maybe it was there, because angels had its own wood production recipe, so amator tried to overwrite it again in data-update-stage ? I didn't try it, so I might post something related to that, if the removal of the redundant code had an effect somewere balance-wise. Anyway, in case you want to know, what I am talking about, here is how the original code for this bug fix at the end of "data-update.lua"-file looked like:

if mods.angelsrefining then
    data.raw.recipe.apm_wood_0.normal.results[1].amount = 14
    data.raw.recipe.apm_wood_0.expensive.results[1].amount = 14
    data.raw['assembling-machine']['burner-ore-crusher'].next_upgrade = nil
end

Again, if you are 100% sure this code was redundant, just ignore this part
Edit: I tested it with Angels. The wood recipe stayed the same, so the wood recipe changes above can be ignored.

With these bug fixes, angels mods should work properly with all the angels related compatibility patches enabled. This took me some time to figure out, I would appreciate if the fixes were implemented. I also wrote some bug fix suggestions in amator nuclear and amator library discussion section.

Have a nice day!

Edit2:
Version 0.23.09 fixed the issues. Thank you very much!

1 year, 1 month ago

Hello again,

I have yet another problem with angel's compatibility in file:

__apm_power_ldinc__/prototypes/integrations/recipe-categories.lua

And this code at line 99 - 106:

if mods.angelsrefining and apm_power_compat_angel then
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_0', 'ore-sorting')

    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_1', 'ore-sorting')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_1', 'ore-sorting-2')

    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-sorting')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-sorting-2')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-sorting-3')

    apm.lib.utils.assembler.mod.category.add('burner-ore-crusher', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher', 'apm_crusher_3')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-2', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-2', 'apm_crusher_3')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-3', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-3', 'apm_crusher_3')
end

I think it should be changed to this:

if mods.angelsrefining and apm_power_compat_angel then
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_0', 'ore-refining-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_1', 'ore-refining-t1')
    apm.lib.utils.assembler.mod.category.add('apm_crusher_machine_2', 'ore-refining-t1')

    apm.lib.utils.assembler.mod.category.add('burner-ore-crusher', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher', 'apm_crusher_2')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-2', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-2', 'apm_crusher_2')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-3', 'apm_crusher')
    apm.lib.utils.assembler.mod.category.add('ore-crusher-3', 'apm_crusher_2')
end

The recipe category "ore-sorting" refers to crafting recipes, which converts crushed items to their ore counter parts, so it shouldn't be in the apm crusher machine as crafting recipe imo. And also you can't crush angel's ore in the apm crusher machines as of right now, as they are in the recipe category "ore-refining-t1".
And the recipe category "apm_crusher_3" doesn't exist or has any crafting recipes, while "apm_crusher_2" has, so this should be atleast added aswell.

New response