Separate but overlapping power grids

Started by vedrit, July 05, 2021, 11:15:59 PM

Previous topic - Next topic

vedrit

I'm trying to make a mod with color-coded power conduits that act the same way as vanilla conduits, in that they can connect to power consumers without any additional buildings (As opposed to Parallel Power Grids, where the color-coded conduits don't directly connect to devices and are more of a carrier between vanilla conduits).
I've got a script that inherits CompProperties_Power and one that inherits CompPowerTransmitter with adjustments to track the grid color, and the ghosts of the colored grid and vanilla conduits don't connect, they become connected after construction. This leads me to believe that the issue lies the PowerNetManager, but it doesn't seem to have any way of handling separate power grids. I can't inherit it and make necessary adjustments, because the parts that need to be changed can't be overridden, and I can't copy it because other related scripts are looking specifically for the PowerNetManager class (such as PowerNet class and, indirectly, the CompPower class)
Am I just trying the impossible, or am I simply missing something?

RawCode

PowerNetManager is not thing, it's part of "engine" and you can't inherit it (actually you can but this won't work well as no method marked virtual)

start googling "harmony+code+injections"

Canute

#2
Do you know
Parallel Power Grid (Parallel Conduits)
https://ludeon.com/forums/index.php?topic=38345.0

Edit:
Sorry, my mistake i oversaw that you mention it allready.

vedrit

Quote from: RawCode on July 06, 2021, 02:52:21 AM
start googling "harmony+code+injections"
I'll look into that, thanks!

Quote from: Canute on July 06, 2021, 03:11:16 AM
Do you know
Parallel Power Grid (Parallel Conduits)
https://ludeon.com/forums/index.php?topic=38345.0
I do know of it, and mention it in my original post:
Quote(As opposed to Parallel Power Grids, where the color-coded conduits don't directly connect to devices and are more of a carrier between vanilla conduits)