Programming Question is there a way to set a fuel amount to a ship

Natively, AFAIK, no. There may be an MFD to do that, though.
 
You could, but you would have to write your own .dll, easier would be to set the ISP so high that it would take years of continuous burning to deplete all the fuel.

I am away from home computer so I cannot test or compile, but something like this; ( psudocode and untested)


Code:
opcPostStep
{
int x = 0;
if (x > 60){ //the x count thing is primarily so that this doesnt have to run every frame, purely for opimization, since I really dont think you will notice the difference over a period of ~1sec.
   x=0;
 
   OBJHANDLE hV = oapiGetVesselByName (char *name); //name here
   VESSEL *v = oapiGetVesselInterface (hV);
 
 
   DWORD pCount = v->GetPropellantCount();
   PROPELLANT_HANDLE ph;
   double pMX;
 
     for (int count = 0; count < pCount; count++)
     {
        ph = v->GetPropellantHandleByIndex(count);
        pMX = v->GetPropellantMaxMass(ph);
        SetPropellantMass (ph,PMX);
     } 
 
 
}
x++;
}


This should work I think and when I get home I can test and compile it for you.
 
Alright there it is attached

just edit the config on which vessels you would like to have infinite fuel.

:cheers:
 

Attachments

Back
Top