RailPowerSystem

by Hermios

Connect rails to electric and signals circuits, and use electric trains

Content
10 days ago
0.14 - 1.1
446
Transportation

b Error

4 years ago

Error while deleting power poles. literally unplayable! https://ibb.co/CwDcxMy

4 years ago

I know, I have to fix it, sorry!

3 years ago

Hi.

I have the same error while dismantle tracks.
But for me the "Lua error" is 64 instead of 33.
I haven't done anything with this mod yet.

Greetings
Illyria

3 years ago

Hi Illyria
Can you post your error? It may be another one.
And explain what you did to get this error.
Thanks
Niko

3 years ago

Hello Niko,

Unfortunately I didn't take a screenshot.
I wrote my post here because my error message looked exactly like Sunemisu's.
The only difference was that at Sunemisu it is 33 at lua. But for me it is lua 64.

I was just about to build the first tracks. (Vanilla tracks)
Of course I wanted to dismantle the incorrectly placed tracks.
And then I got this error message.

I hope you understand me?
I am having problems with english ...

greetings
Illyria

3 years ago

Hi Illyria
Your english is definitely good enough :) Thanks for making the effort btw (Not sure mine is great either :D )
I understand.
can you tell me, which version of the mod you use?
Many thanks

3 years ago

Hi Niko,

I try hard. Even if the Google translator has to help me. :)
Of course I would prefer German. But not everyone speaks this language. ;)

I use the mod version 0.4.2.
So the current version of your mod.
Could it be the Factorio version?
But I've already noticed that some mods have problems with 0.18.22. A good example "FNEI". This mod just doesn't work with the latest Factorio version.
Other mods also needed an update. Then they worked again.
Something must be different at 0.18.22.
Just an idea from me ... Maybe it's just a little thing.

greetings
Illyria

3 years ago

Hallo Illyria
Ich spreche eigentlich deutsch, aber wie du sagst, nicht jeder kann es :)
So, let's continue in english.
If your line is different from the one of Sunemisu, but the issue is the same, this may be because you used different versions. This is why I asked.
The problems comes definitley from my MOD, I know what the issue is, I started to work on it, but I struggle to find a solution.
Maybe this week end
Niko

3 years ago

Hi Niko,

Trotzdem schön, die eigene Sprache zu lesen. :D
Wärst du damit einverstanden, englisch sowie deutsch zu schreiben?
Englisch, damit die anderen es verfolgen können. Und deutsch, damit ich mich
besser ausdrücken kann.

Offenbar verwendet Sunemisu dieselbe Version wie ich. Ich halte meine Mods grundsätzlich aktuell.
Apparently Sunemisu uses the same version as I do. I keep my mods up to date.

Nur wie ich heute herausgefunden habe, darf man nicht jede Mod aktuell halten.
So funktioniert die neuste Krastorio 2 überhaupt nicht mehr und wirft 5 Fehler aus. Naja ...
Just as I found out today, you shouldn't keep every mod up to date.
The latest Krastorio 2 doesn't work at all and throws 5 errors. Well ...

Schön zu hören, dass du die Ursache für den Fehler gefunden hast. Freue mich auf das Update!
Die Anderen bestimmt ebenso. Ich danke dir! Für die schnelle Reaktion und deine Zeit.
Nice to hear that you found the cause of the error. Looking forward to the update!
The others also determine. I thank you! For the quick reaction and your time.

Grüße/Greetings
Illyria

3 years ago

Is there a solution for this issue yet? Or a work-around so the power poles can be removed without the mod crashing (like there is on GitHub for the error Illyria points out on line 64)?

3 years ago

I just got this error. It sounds a lot like one that was mentioned earlier in the thread...hopefully it will help you get a fix for it. I was looking forward to trying the mod out, but if it is going to crash my game when I try to mine an object that won't work. (In this case it was a track segment...I tried a power pole after reloading the game and reading this thread and it seems to be ok.)

Error while running event RailPowerSystem::on_pre_player_mined_item
(ID 11)
RailPowerSystem/methods/globalEvents.lua:64: attempt to index
field '?' (a nil value)
stack traceback:
RailPowerSystem/methods/globalEvents.lua:64: in function
'OnRemoved'
HermiosLibs/controlLib.lua:92: in function
<HermiosLibs/controlLib.lua:84>

3 years ago

For the error on mining a track segment (/methods/globalEvents.lua:64) is a quickfix available on the GitHub page of this mod (not an official fix, but it works.
Mining a Power Pole results in a similar error bit on a different line (/methods/globalEvents.lua:33). No fix available yet (as far as I'm aware).

3 years ago

Thanks, that worked! (I followed the error to that line myself, but I'm not familiar enough with the programming language to know that was what I needed to do, just that it looked different from the surrounding lines.)

3 years ago
(updated 3 years ago)

Made a similar fix for the error on line 33.
replace lines 32-37:

connectorEntity.OnRemoved=function(entity)  
    local connectedRail=listRailPoleConnectors[entity.unit_number]:remove()
    if connectedRail then
        table.insert(listConnectionsToClean,connectedRail)
    end
end

with:

connectorEntity.OnRemoved=function(entity)  
    if listRailPoleConnectors[entity.unit_number] then
        local connectedRail=listRailPoleConnectors[entity.unit_number]:remove()
        if connectedRail then
            table.insert(listConnectionsToClean,connectedRail)
        end
    end
end

This allows the connector poles to be removed. Don't know if this causes problems elsewhere in the mod (haven't noticed yet...)

3 years ago
(updated 3 years ago)

I did the same thing. Haven't run into any issues yet and been running it for a couple days now. (Before changing the code,) I also noticed that the error is semi-intermittent and pole specific. I had one section where I could place and remove a new pole at will, but the old pole in the same area would crash. I had another section where I was changing rail types to electric, accidentally removed too much rail and it didn't reconnect to the electrified rail when replaced. I tried to mine it so I could re-place it and connect in "auto" mode and it crashed. After reloading and getting back to that spot I saved the game (just so I didn't have to do all the work a 3rd time) and just to see what would happen I tried to mine the pole again and it was fine. I even deleted the same section of rail and re-placed it, and it reconnected just fine.

I also noticed the system over-all doing strange things with power connections. I usually have to go in and manually connect normal power poles around electrified rails so they connect correctly for example. Once I even had a pole tell me I had a pole with 5 existing connections when it didn't. I had to shift click to make it think all connections had been removed and manually reconnect the connections it was supposed to have. Maybe there is a way to make the rails only connect to other rails and rail power poles to start with so the "clean-up" code that looks like is there just isn't needed?

3 years ago

I haven't played Factorio in a while ...
I also use the mod "Realistic Electric Train".
Possibly a conflict between the two?
But when I read the messages of the other users here, I doubt that it is because of the other mod. Would be a crazy coincidence, everyone here would have installed this mod in parallel ...

New response