Longer Underground Belt (Aligned)

by Peppe

Extends underground belt distance based on their speed. Fixed optional mod bob's logistics. Credit Schmendrick, Loren1350, for past versions

3 years ago
0.14 - 1.1
13.9K

b Funky behaviour with Dp77s FactorioPlus: Hyper Logistic

4 years ago

Hi,

I use an (old, v1.3.0) version of the Hyper Logistic mod; which works after a tweak or two. This is the version before the original author added integrations with his other mods, which I don't want. However, I also use your mod to fix the belt lengths for my own laziness. However, after the first tier added by the mod; the lengths will break. I'm waay too far out of the current API to try to fix this myself; so I'm turning to you :-) Is this something that can be fixed?

Issue: https://imgur.com/uKRx0Hb

It appears to be honoring the default lengths for the pink and light-blue belt. I've placed them a bit further where I think they should've been. Is there perhaps a documented version of the code so I can take a look myself?

I'm not allowed to share the modded version of Hyper Logistic (bad license, booh), but we'll figure something out ;-)

Thanks.

4 years ago

If the belt speed is faster it should make them longer. Mods can of course add their items or make changes after my mod has already applied them. Like I think bob's config for underground belts runs after mine.

Not sure how the mod you are having issues with does it's belts/configs.

All mods are in plain text in their zip file. Feel free to open/modify mine however you like to get it to suite your needs. Though i would suspect it is a timing issue or the belts in the mod are slower than blue?

4 years ago

The mod just adds new entities as far as I can see (nothing in the data script; nor separate scripts); and they're all faster than blue (they're in order on the picture). The two 'bugged' belts actually have the exact same speed (little bug in the mod). The other belts are in fact changed by your mod. Even if I change the belt speed of the undergrounds; nothing changes. So I guess the calculations aren't applied to those two specific belts?

Can you explain how you select the belts and iterate over them? That's basically the part of the Factorio API that I don't know :-)

4 years ago

should just be the one data-final-fixes file.

I inherited this, so the variable names are not my style / easy to understand.

It gets all the underground belts and belt (all vanilla and mod belts/underground derive from the data.raw transport-belt and underground-belt). It uses yellow belts to set a base speed and the rounds the distance to 6.

Then uses the speed to get the distance as a multiple of 6 for the item and eventually set that distance -1 for the underground belt.

The whole bottom half of the script from 58 on just modified recipes to add belts into the recipe.

4 years ago

So I spent some time fiddeling around with some logging in your mod; and I can't figure out why it's being funky like this. The 'underbelts' array actually has the correct entities, but the 'underground' doesn't. I see the loop at line 22 doing stuff with it; but as far as I see all the belts are minable? Or what else is that check?

4 years ago

Mods can add belts/undergrounds that are not mine-able -- assume it is just a safety check to prevent mod conflict.

Then the line that runs replaces the existing distance value with the new value. Not sure why it is buried in the result of the item, but i have not looked at the base entities in a while.

New response