Factorio Qol Age: Resorted Items


This mod partially changes the order of items within the Logistics, Production, and Combat groups.

Utilities
17 hours ago
2.0
1.46K

i [Added] Advanced Belts

2 days ago

Hi, I like this mod very much so I'm making a suggestion to include the 3 new Belt Tiers from the mod https://mods.factorio.com/mod/AdvancedBeltsSA.

The AAI Loaders are already together as you can see in the screenshot, but the underground belts and splitters are at the wrong position.

https://i.imgur.com/HjRgUQ0.jpeg

a day ago

Thank you for your suggestion. I will add it during the week.

a day ago

Done! Please tell me if the implementation works as you expected.

a day ago

Thank you for the quick update.
Unfortunately it doesn't quite work.

Failed to load mods: factorio_qol_age_resorted_items/logistics.lua:33: attempt to index field 'military-transport-belt' (a nil value)

I looked at the code you changed and it seems you extended the new belts into the Castra "military-transport-belt" category, which doesn't exist without Castra installed as well.

In the code if AdvancedBelts is installed, it sets castra = true even when Castra is not installed.

a day ago

Thank you for your detailed feedback. Copy and paste is both a curse and a blessing.
The error should now be fixed.

a day ago

Yes I thought that was what happened :)

Unfortunately there is another issue...

As you can see in the screenshot from before https://i.imgur.com/HjRgUQ0.jpeg the Advanced Belts mod adds 3 new lane splitters for the new tiers. I on the other hand wasn't interested in those and so I don't have the mod https://mods.factorio.com/mod/lane-splitters installed.

There is now the Error:
Failed to load mods: factorio_qol_age_resorted_items/logistics.lua:123: attempt to index field 'fast-lane-splitter' (a nil value)

Your code checks if AdvancedBelts is enabled and then adds the new lane splitters to the others, which don't exist without the lane-splitters mod...

This is all a bit of a convoluted mess. Who even needs 7 belt tiers anyway :)

a day ago

OK, I'll remove this version for now and take another look at it with a fresh mind tomorrow.

Without the Lane Splitter Mod, should single-lane splitters have their own row, or should they be behind normal splitters in the same row?

a day ago

I think you had the right idea to put them in a separate group. I did the following change to show my idea for the situation: https://pastecode.io/s/xe72c4fk

There are 3 mods that add lane splitters as far as I know (or care so far):
- Lignumis: Tier 0
- Lane Splitters: Tier 1-3
- Advanced Belts: Tier 4-7

So in the code I changed it to check if either of the 3 is installed. If yes, then it does the data:extend to create the lane-splitter subgroup. Then it checks all 3 mods individually again and if enabled, adds their Tier.

It worked so far for me only with the Advanced Belts mod and with all 3 together. But when all 3 mods are installed, the 3 lane splitters from Advanced Belts are on the left. I don't know how sorting horizontally works.

I hope my idea like this is understandable

17 hours ago

The new attempt is now online. I have also implemented the horizontal sorting you suggested.
Please let me know if everything is working as you would like it to.

17 hours ago

I just checked and it's working as intended now.
Thank you very much for adding the support and required changes!

16 hours ago
(updated 16 hours ago)

Just updated to 1.0.12 and got an error which could be related to this thread.

Failed to load mods: factorio_qol_age_resorted_items/logistics.lua:125: attempt to index field 'wood-lane-splitter' (a nil value)
stack traceback:
factorio_qol_age_resorted_items/logistics.lua:125: in main chunk
[C]: in function 'require'
factorio_qol_age_resorted_items/data-final-fixes.lua:1: in main chunk

Seems to come from the wood splitters from Lignumis. Or... the lane splitters (smaller splitters that balance the lanes of a belt) which I do not have installed. I'm not a modder myself, just wanted to leave the error message. Will leave it disabled and check back later.

Thank you.

Edit to clarify: I do have Lignumis installed but not a mod that adds small lane splitters.

12 hours ago

Oh I see the problem. I got something confused between the 3 mods.

Lignumis only adds the Wood Lane Splitter when the Lane Splitters Mod is installed. Advanced Belts on the other hands adds its 3 Lane Splitters even if the Lane Splitters Mod isn't installed.

To fix it, I think it would be enough to remove the "lignumis" from the if clause in line 116 from logistics.lua:

-> "if lane_splitters or AdvancedBelts then"

I think the rest is working as intended. But you could also move the "if lignumis then" into the "if lane_splitters then" for no functional reason.

https://pastecode.io/s/meofn08r

Sorry about the mess!

New response