Fuel hoses and air-to-air refueling
gyrohero opened this issue ยท 2 comments
The idea here is to allow vehicles to only connect to refueling stations/tanks from certain points. That would allow car fuel ports that are actually functional, as well as aircraft with refueling probes and booms.
I propose having an optional list of fuelInputPoints which can be in the vehicle motorized section, or in a part JSON. The former would serve fuel ports for cars, and the latter would serve customPart refueling booms.
Then there could also be a fuelOutputPoints list in parts, for refueler planes' probes or fuel trucks' hoses. The probe can pull from any interactable tanks on the vehicle.
An autoConnectDistance parameter in each one would establish how close the input and output points need to be to automatically connect and start fueling. Otherwise, they'll have to be manually connected with a fuel hose.
A possibly difficult bonus would be to have the probe or hose animate to remain visually attached to the fuel input point until outside the autoConnectDistance.
I'm planning on working on a C-130 to serve as a refueler platform, and @LauraDarkez is planning on making a refueler boom attachment for her PhoenixHawk. I'll probably do the same for my Chinook.
Closing due to the sheer complexity of animating a hose system and doing the math for hose connections. Existing fuel hose allows tank-to-vehicle transfers for aircraft re-fueling, even though it doesn't animate. Essentially, it's good enough for the function. And I don't wanna try and code the hose-code myself.
General consensus from Discord
Vehicles:
- Have a list of fuelPoints. When attempting to fuel, it'll find the nearest point and connect to that. Each point will likely have to be its own object so it can have additional attributes like linkedDoor (to disable use when a fuel door is closed) and rotation (to define the direction from which a fuel nozzle should attach)
- Players will still just have to right click the vehicle, not the fuel point itself, when attempting to connect.
- There will be an autoconnect distance for air-to-air refueling purposes.
Suppliers:
- Can be a pump block or interactable barrel on a vehicle. For the latter, if feedsVehicles is true, it should be able to supply from the vehicle's internal tanks as well (two-way fuel flow).
- Will need objects for the nozzle and a single segment of the hose.
- Define points for hoseStart (where the hose meets the pump, tanker, etc.), hoseEnd (where the hose meets the nozzle object, and nozzlePosition (where the nozzle should connect to the vehicle's fuel point). The positions for hoseEnd and nozzlePosition should correlate to points on the nozzle when the nozzle is in its stowed position.
- Should also be able to define the desired rotation of the nozzle when it attaches, relative to its rotation when stowed
- Each hose segment should be able to extend a definable amount. If the segment attempts to extend beyond this, it will automatically disconnect
- Should be able to determine whether the hose can bend throughout its length, or only at the hoseStart and hoseEnd. In the latter case, the it should only bend at those points until a defined angle, after which it will disconnect
Vehicle Animation Variables:
- fuelpoint_#_connected -- boolean
- fuelpoint_#_fueling -- boolean