Power Overload


Performant, semi-realistic power distribution overhaul. Power poles can explode if the total electrical consumption on the network is too high. Use transformers to separate networks so that subnetworks do not take more power than they can handle.

Content
1 year, 2 months ago
1.1
3.07K
Power

b [Fixed-1.2.4] Crash on load after last update

1 year, 11 months ago

Should be basic-crafting or advanced-crafting?

14.679 Error ModManager.cpp:1588: Failed to load mod "PowerOverload": PowerOverload/prototypes/fuses.lua:56: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
PowerOverload/prototypes/fuses.lua:56: in main chunk
[C]: in function 'require'
PowerOverload/data-updates.lua:2: in main chunk
14.680 Loading mod core 0.0.0 (data.lua)
14.805 Checksum for core: 3123733693
14.846 Error ModManager.cpp:1588: Error in assignID: recipe-category with name 'crafting' does not exist.

1 year, 11 months ago
(updated 1 year, 11 months ago)

Hello, sorry for the crash. It doesn't appear in vanilla so I think that you have another mod interfering with crafting categories ('crafting' is usually a valid category and I don't set it myself anywhere).

Regardless, v1.2.3 partially reverts the load-order changes that I made in v1.2.2, so I think that it will fix your issue. If it doesn't, please send a list of mods so that I can try to reproduce the crash.

1 year, 11 months ago

No worries - and you are right. I misread the wiki, sorry about that. Let me do some debugging later this evening.

1 year, 11 months ago

I don't know what the issue is yet, but I get this error in 1.2.3. The ingredients for 'small-power-pole' are Nil at the time the script runs. I'll look more when I have more time - very strange.

14.203 Error ModManager.cpp:1588: Failed to load mod "PowerOverload": PowerOverload/prototypes/fuse-recipes.lua:20: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
PowerOverload/prototypes/fuse-recipes.lua:20: in main chunk
[C]: in function 'require'
PowerOverload/data-updates.lua:2: in main chunk
14.205 Loading mod core 0.0.0 (data.lua)
14.334 Checksum for core: 3123733693

1 year, 11 months ago

Well it works fine for me so if you want me to help I'm going to need a modlist :)

1 year, 11 months ago

Moving require "PowerOverload/prototypes/fuses" to data-updates.lua from 1.2.1 is sufficient to trigger the issue, hopefully that helps narrow it down. I'll open an issue on your github and give you a save file there.

1 year, 11 months ago

Issue with a save file is here : https://github.com/tburrows13/PowerOverload/issues/1

1 year, 11 months ago

I should have guessed it would be Space Exploration (well AAI Industry, but close enough...)

The problem is that there are 2 valid ways of defining recipes, you can do it all in the base table, or define a .normal and .expensive (https://wiki.factorio.com/Prototype/Recipe#normal). I had been assuming only the first way, but AAI Industry converts it to the second, and now I have to make it work in both cases. It worked when it was in data.lua rather than data-updates.lua because my modifications occurred before AAI Industry changed it. But the whole point is that the recipes are adjusted based on other mods' modifications (fuse cost is always 20x the cost of the associated power pole) so it has to stay in data-updates.

I've spent ages trying to come up with something that works with all types of recipe definitions but it is proving to be harder than anticipated so I'll have to try again tomorrow.

1 year, 11 months ago

Actually I came up with a better solution - fixed in v1.2.4 (tested with SE, AAI Industry, K2 and BZ combined) but I didn't fancy actually downloading all of your mods to load your save :)

Let me know how you find it with K2SE - the default maximum consumptions are at least increased when using K2 (though if you first loaded Power Overload without K2 it won't change the starting values, you'll have to reset them to default in the settings). I don't know how balanced it is even with those changes though.

1 year, 11 months ago

Ah, glad you found it! I had some issues with that in one of my earlier mods - something was nagging me but I couldn't remember. I ended up using bob's library as it had a good set of abstractions for working with recipes.

I just tested with 1.2.4 and it's working great - thanks!

I think the power settings are good (I started a new game after you adjusted the K2 settings). I don't have medium poles automated yet and just had to split my steam generators into two networks - so I'd say it's tuned correctly, for my playstyle at least. I'll be looking at nuclear power about the time that I need to split the medium pole network, most likely. I'll let you know as I progress though.

I like what you've done here btw. I played with another electric capacity mod a few years ago and am pretty happy with your mod so far. Fuses are a great idea.

1 year, 11 months ago

Glad you like it. You should find the high energy interface useful for powering the defence umbrella and maybe some K2 buildings. Also I don’t think I’ve added support for entity cloning so poles on spaceships will probably never explode, and transformers will become disconnected.

New response