New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting power cables between appliances and vehicles #60851
Conversation
Allows cables with the CORD_ATTACH action to connect vehicles and appliances, provided they are fitted with a power inverter.
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details. Click to expand
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to |
If we are bringing in the AC/DC distinction, does it make any sense to limit it to just vehicles? Solar panels and batteries are also DC and would require inverters to power AC appliances, and charging batteries from AC sources would require a charger (rectifier and regulator). Plus it's not always true that vehicle = DC. The "Portable Generator" vehicle should output mostly AC (while having its own internal DC electrical system with limited capacity) Don't get me wrong I would love realistic electrical systems I'm just not sure if this is a can of worms worth opening, considering all the implications. |
I'm not really attached to the power conversion stuff, I'm fine with the simple fix as well. But I see your point about current types in vehicles/appliances. I'll add a way for vehicle/appliance definitions to declare how they should be treated in the grid. |
I don't think the AC/DC distinction is as big as a deal for anything other than the big motor appliances. Lamps and heating elements don't care what the current is doing, and DC will make it through a rectifier fine for any of the control circuits (albeit not at peak efficiency/reliability). In addition, universal motors are surprisingly common in smaller appliances and will cope well with either type of current. The bigger issue is voltage & amperage, but that is already pretty abstracted from what the survivor is doing. If its really that important we could just make a middling electronics skill and the generic "power converter" item required for setting up some of the more sensitive types of appliances; presumably that would cover any glaring AC/DC problems too |
Summary
None
Purpose of change
The other concern pointed out in the comments in the linked issue is that you shouldn't be able to transfer power directly between vehicles and appliances, since vehicles run on DC power while most appliances connect to AC sources. In reality that would require some kind of rectifier (like the ones found in power supplies) or a commercial power inverter:
Describe the solution
So the order of operations for connecting an appliance to a vehicle would be:
a
ctivate either the cable or the inverter to attach the inverter to the cablea
ctivate the converted cable and connect both the appliance and the vehicle2022-09-08.02-10-30.mp4
Describe alternatives you've considered
Forgetting the AC-DC power conversion and just fixing the linked issue. In that case, the fix would only be 2 lines:
Testing
Added a unit test to check that the power inverter iuse action works from both the inverter and the cable:
Also tested in-game:
Additional context