Programming Question Help with changing docked vessel fuel content

Mr Martian

Orbinaut/Addon dev/Donator
Addon Developer
Donator
Joined
Jun 6, 2012
Messages
382
Reaction score
254
Points
78
Location
Sydney, Australia, Earth, Sol
Website
www.orbithangar.com
Hi, I am wondering how I would go about changing the amount of fuel in a docked vessel? (Example being, say I am in a.delta glider and am docked to a ShuttlePB, the focus vessel is the Delta Glider (im in that) and iI want to change the fuel content of the ShuttlePB from the Delta Glider)... Hope that makes sense.

Any help would be much appreciated.
 
[ame="http://www.orbithangar.com/searchid.php?ID=3320"]Fuel MFD[/ame]

[ame="http://www.orbithangar.com/searchid.php?ID=4725"]Refuel MFD[/ame]
 
You can use oapiGetDockStatus to get the handle of the vessel docked at a docking port. From there, you get get the PROPELLANT_HANDLE of the fuel tank you want, and alter its contents.

oapiGetDockStatus will return NULL if there is no docked vessel, so make sure to use a sanity check to prevent CTDs when trying to use an invalid vessel handle (oapiIsVessel).
 
Last edited:
Back
Top