Poles with limited power distribution

Place to get help with not working mods / modding interface.
Post Reply
EffectiveLimit
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Aug 31, 2019 7:01 pm
Contact:

Poles with limited power distribution

Post by EffectiveLimit »

So I want to give poles a realistic-ish trait of having a limit to how much power they can give. For example, one small pole can give no more than 300 kW (numbers irrelevant, i will balance them), so it will distribute these 300 kW equally to all entities connected to it regardless of how much you actually produce in general. But I can't find a good way to do it, "electric-pole" prototype doesn't use limits, other prototypes also work a bit different and I'm new to modding. Is there a way to do so?

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Poles with limited power distribution

Post by Ranakastrasz »

https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Poles with limited power distribution

Post by eradicator »

EffectiveLimit wrote:
Sat Aug 31, 2019 7:17 pm
Is there a way to do so?
No.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Poles with limited power distribution

Post by eradicator »

Ranakastrasz wrote:
Sat Aug 31, 2019 7:45 pm
https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.
Lulz, a 0.13 mod, where did you dig *that* up :D. (Hey, that means the portal exists longer than i thought.)
Quick look at code...looks like it calculates all energy transfer itself and uses red-circut wire to remember the connections (because it has to delete the real ones to prevent them from interfering). Probably extremely slow, bugprone and user un-friendly.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

EffectiveLimit
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Aug 31, 2019 7:01 pm
Contact:

Re: Poles with limited power distribution

Post by EffectiveLimit »

eradicator wrote:
Sat Aug 31, 2019 7:57 pm
Ranakastrasz wrote:
Sat Aug 31, 2019 7:45 pm
https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.
Lulz, a 0.13 mod, where did you dig *that* up :D. (Hey, that means the portal exists longer than i thought.)
Quick look at code...looks like it calculates all energy transfer itself and uses red-circut wire to remember the connections (because it has to delete the real ones to prevent them from interfering). Probably extremely slow, bugprone and user un-friendly.
Well, it seems that it worked back then. And it does exactly what I want. But yeah, I can't figure out what happens in control.lua at all.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Poles with limited power distribution

Post by Ranakastrasz »

I had seen it, or something like it before. And I went and searched for "Factotio Power Network Mod" and a bunch of synonyms til I found it. There might be another, but I couldn't find one.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Re: Poles with limited power distribution

Post by mat1k »

It could possibly be done BUT the performance cost of the scripting required would make it unviable. A better option would be to go to the interface requests forum and ask for a throughput_limit = χ kw

It would be a lot easier to implement on the c++ side than with the limited abilities of lua.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Poles with limited power distribution

Post by eradicator »

EffectiveLimit wrote:
Sat Aug 31, 2019 8:12 pm
Well, it seems that it worked back then. And it does exactly what I want. But yeah, I can't figure out what happens in control.lua at all.
Lots of things "work" in theory, but are too slow to be fun. This one will definetly not be fast enough for you to enjoy the game unless you're fine with <60UPS before launching your first rocket.
mat1k wrote:
Sat Aug 31, 2019 10:31 pm
A better option would be to go to the interface requests forum and ask for a throughput_limit = χ kw
That would be closed without even a comment. The whole electric network code is based on the assumption that there is no limit. Look at the "make fluid behave like electricity" threads where people argue to remove the flow limit to get more UPS.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”