Krastorio 2


An overhaul mod focusing on end-game technologies and moderately increased complexity.

Overhaul
6 months ago
0.18 - 1.1
303K
Transportation Logistics Trains Combat Armor Mining Fluids Logistic network Manufacturing Power Storage

b [Fixed] Strange Interactions between K2 and Optera's Lighted Electric Poles +

3 years ago

The mod LEP+ ( https://mods.factorio.com/mod/LightedPolesPlus ) from Optera interacts strangely with K2:
"Lighted Substation" and "Lighted Substation mk2" seem to have the following issues:
- they can't be requested by Logistics network ( or by Klonan's Transport Drones)
- they can't be registered in an "Upgrade-Planner" to change existing "substation" to "lighted substation"

On the surface this seems like an issue with LEP+, but after reporting this to Optera, he mentioned that there is something funky about the way K2 handles the Substation MK2.

To me it seems like this is one of the annoying borderline cases where the best way to resolve this would be to look into it from both sides...

My related post in LEP+ is : https://mods.factorio.com/mod/LightedPolesPlus/discussion/5eca459c3cf12a000e12a701

Thanks for looking into this.

Linver β˜†
3 years ago
(updated 3 years ago)

About:
- they can't be requested by Logistics network ( or by Klonan's Transport Drones)
Don't concern my stuff
about:
- they can't be registered in an "Upgrade-Planner" to change existing "substation" to "lighted substation"
May I will check if the upgrade are is well

3 years ago
(updated 3 years ago)

Hi Linver,
as you mentioned that you'll not consider it a issue that you are intending to fix, i have looked into it a bit myself, and would like to propose the following fix:

In "Krastorio2\prototypes\items" you are introducing the Substation mk2 as "hidden" and this is the item that gets extended with a Lamp by "Lighted Electric Poles+"
In "Krastorio2\prototypes\vanilla-changes\optional" you are checking if the Substation MK2 is enabled and removing the hidden flag if it is.

data.raw.item["kr-substation-mk2"].flags = nil
data.raw["electric-pole"]["substation"].fast_replaceable_group = "substation"
data.raw["electric-pole"]["substation"].next_upgrade = "kr-substation-mk2"

As this is a custom way of enabling the item, LEP does not know about this, resulting in the reported issues.

As you have a Compatibility script for Lighted Electric Poles + in "Krastorio2\compatibility-scripts\data-final-fixes\LightedPolesPlus.lua" anyways, I would suggest the following extension of the compatibility script:

        if krastorio.general.getSafeSettingValue("kr-substation-mk2") then
            -- also unhide lighted mk2
            data.raw["item"]["lighted-kr-substation-mk2"].flags = nil
            --fix fast_replaceable_group
            data.raw["electric-pole"]["lighted-substation"].fast_replaceable_group = "substation"
            -- remove specific upgrade path
            data.raw["electric-pole"]["substation"].next_upgrade = nil
            data.raw["electric-pole"]["lighted-substation"].next_upgrade = nil
        end

Thanks for looking into it.

Linver β˜†
3 years ago

Oh thank u for solving the problem, I will test it and if work properly I will add it in the next update.