Allowed Modules


Adds tooltips listing when a recipe's allowed modules differ from the default.

Utilities
a day ago
2.0
132

b Localised string key is too large

6 days ago

Hey, i tried to use your mod together others (A LOT OTHERS), and got this error

12.740 Error ModManager.cpp:1745: Error while loading recipe prototype "basic-oil-processing" (recipe): Localised string key is too large: 1724 > 200 (limit). in property tree at ROOT.recipe.basic-oil-processing.localised_description[2][1]
Modifications: Base mod › AAI Industry › 5Dim's mod - New Core › Allowed Modules

P.S its not a single recipe with error, its just an example above...

I checked and theres a lot of modules availables on my pack, and they add too much data on your table.insert

I used ChatGPT to try some workaround and he gave me the option to
1 check if the insert surpass the 200 limit
2 if not surpass just add the info
3 if surpass truncate and add

It worked, its a mess the code and the game output, but it worked....

If need help/info/mods/saves just ask

5 days ago

Hmm, can I have a save with all your mod's enabled, so I can see what's the best way to truncate it?

5 days ago

Ok, first of all thank you for using my mod, but using 393 mods at once seems like way too many!
Similarly, the basic-oil-processing recipe is allowing way 16 different types of modules (including each separate level, this is 57 modules), this is just unreasonable.

As is the localised description my mod was generating:

{"", 
    { "?", {"", { "recipe-description.basic-oil-processing" }, " " }, "" }, 
    { "allowed-modules.allows-module",
        "[img=item.productivity-module][img=item.productivity-module-2][img=item.productivity-module-3][img=item.alien-module][img=item.alien-module-2][img=item.alien-module-3][img=item.infinity-module][img=item.infinity-module-2][img=item.infinity-module-3][img=item.npc-civilian-miner1][img=item.npc-civilian-miner2][img=item.npc-civilian-miner3][img=item.npc-civilian-furnace1][img=item.npc-civilian-furnace2][img=item.npc-civilian-furnace3][img=item.npc-civilian-factory1][img=item.npc-civilian-factory2][img=item.npc-civilian-factory3][img=item.npc-civilian-science1][img=item.npc-civilian-science2][img=item.npc-civilian-science3][img=item.npc-civilian-oil1][img=item.npc-civilian-oil2][img=item.npc-civilian-oil3][img=item.npc-civilian-hazmat1][img=item.npc-civilian-hazmat2][img=item.npc-civilian-hazmat3][img=item.Schall-EP-module-1][img=item.Schall-EP-module-2][img=item.Schall-EP-module-3][img=item.Schall-SP-module-1][img=item.Schall-SP-module-2][img=item.Schall-SP-module-3][img=item.Schall-SEP-module-1][img=item.Schall-SEP-module-2][img=item.Schall-SEP-module-3][img=item.y_modul_science][img=item.y-pink-module-1][img=item.y-pink-module-2][img=item.y-pink-module-3][img=item.5d-merged-module-01][img=item.5d-merged-module-02][img=item.5d-merged-module-03][img=item.5d-productivity-module-04][img=item.5d-merged-module-04][img=item.5d-productivity-module-05][img=item.5d-merged-module-05][img=item.5d-productivity-module-06][img=item.5d-merged-module-06][img=item.5d-productivity-module-07][img=item.5d-merged-module-07][img=item.5d-productivity-module-08][img=item.5d-merged-module-08][img=item.5d-productivity-module-09][img=item.5d-merged-module-09][img=item.5d-productivity-module-10][img=item.5d-merged-module-10]" }}
5 days ago

Well, I managed to fix it without truncating the description at all, by using another {"", ...} block to concatenate strings, instead of giving it a literal that is over 200 characters long:

{"", 
    {"?", {"", {"recipe-description.basic-oil-processing"}, " "}, ""},
    { "allowed-modules.allows-module", 
        { "",
            "[img=item.y-pink-module-1][img=item.y-pink-module-2][img=item.y-pink-module-3][img=item.y_modul_science][img=item.productivity-module][img=item.productivity-module-2][img=item.productivity-module-3]",

            "[img=item.5d-productivity-module-04][img=item.5d-productivity-module-05][img=item.5d-productivity-module-06][img=item.5d-productivity-module-07][img=item.5d-productivity-module-08]",

            "[img=item.5d-productivity-module-09][img=item.5d-productivity-module-10][img=item.5d-merged-module-01][img=item.5d-merged-module-02][img=item.5d-merged-module-03][img=item.5d-merged-module-04]",

            "[img=item.5d-merged-module-05][img=item.5d-merged-module-06][img=item.5d-merged-module-07][img=item.5d-merged-module-08][img=item.5d-merged-module-09][img=item.5d-merged-module-10]",

            "[img=item.alien-module][img=item.alien-module-2][img=item.alien-module-3][img=item.infinity-module][img=item.infinity-module-2][img=item.infinity-module-3][img=item.Schall-EP-module-1]",

            "[img=item.Schall-EP-module-2][img=item.Schall-EP-module-3][img=item.Schall-SP-module-1][img=item.Schall-SP-module-2][img=item.Schall-SP-module-3][img=item.Schall-SEP-module-1]",

            "[img=item.Schall-SEP-module-2][img=item.Schall-SEP-module-3][img=item.npc-civilian-miner1][img=item.npc-civilian-miner2][img=item.npc-civilian-miner3][img=item.npc-civilian-furnace1]",

            "[img=item.npc-civilian-furnace2][img=item.npc-civilian-furnace3][img=item.npc-civilian-factory1][img=item.npc-civilian-factory2][img=item.npc-civilian-factory3][img=item.npc-civilian-science1]",

            "[img=item.npc-civilian-science2][img=item.npc-civilian-science3][img=item.npc-civilian-oil1][img=item.npc-civilian-oil2][img=item.npc-civilian-oil3][img=item.npc-civilian-hazmat1]",
            "[img=item.npc-civilian-hazmat2][img=item.npc-civilian-hazmat3]" }}}

Now due to a stupid mistake in my code, at one point I was producing a {"", ...} with too many parameters (the limit is 20). So I went even further and made it nested the {"", ...} if necessary (e.g. `{"", {"", "[img=item.module1], ...}, "[img=item.another-module]", ...})

So now my mod will work if you have 306 different modules, each with a name of 189 characters. Which is just way too many.

5 days ago

In addition, when I loaded your save, I got an error:

Error while running setup for entity prototype "small-lamp-CS-1" (lamp): next_upgrade target (5d-lamp-02) must have the same bounding box.

Which I fixed by disabling the SchallCircuitScaling mod (but then when I opened your save, it gave me a whole list of entities it deleted).

5 days ago

I've also added a screenshot to the mod's info page, showing the horror that is the description for Basic Oil Processing (with 57 modules listed!)

4 days ago

Hey, srr for the delay, can you list the mods and versions that worked to you for the save?
Even after deleting all mods and downloading all back, without SchallCircuitScaling...

I tried to use the mod after the update but no icons are show like the screenshot, just says: Allows Modules
Ctrl shift F factorio debug says in the local description: ""+?(""+ recipe-description.basic-oil-processing + " " ||""+ allowed-modules.allows-module(""+"")

3 days ago

Oh god I'm horribly stupid (somehow I change a for e, actual loop into for _, actual, but lua being lua didn't give me an error when I used e, it just gave me nil).
I've fixed it now and the version I uploaded should definitely work.
Let me know if you have any more problems!

3 days ago

Simply awesome, all works great now!
Thx for the mod!

New response