Okay, following what you said the passing of gen_id and other data like if machine is on/off, how much power it consumes and updating that when we turn a machine on/off or changing it's power consumption value and sending that info back to generator now works. But, I feel this (what i was trying to do) is limiting the flexible system you made.
"Or does each component use the power it needs and pass the leftover power down the wire?"
Yes, each comp. uses the power it needs and passes left-over along the wire. What I've been trying to do would limit player experience and make electricity unintuitive.
I guess what you're saying would make more sense and this might be a lot better;
- A network can have many generators that can only be connected to batteries
- A network can have many batteries that send out the power to components
- Each component uses the power that IT NEEDS and passes left-over power back to be saved in batteries on network
- If there isn't enough power being produced, all machines get turned off?
*The sole purpose of nodes (relays) is just to extend the reach, I can't have kilometer long cables
*Components have a manual switch that sets power_consumption to 0 (turns them off completely)
*Same for Generators, have switch that sets power_production to 0 (turns them off completely)
Would adapting something like this be possible in one of your systems or do you have any systems in mind that would be better or simpler?
File with gen_id being passed around: https://easyupload.io/9m2os2
A system with multiple batteries and generators example (basically what i'd need to accomplish):