TEMPEST.114 Posted January 30, 2023 Posted January 30, 2023 All I can find in the API is the 'getFuel' which is the internal fuel as a float of the aircraft itself. For a TANKER e.g. KC135MPRS - does this include the fuel it provides to other aircraft? If so, what is the limit it will drop to before it RTB's and if it is, how do I determine how much fuel it has left in LBS for refuelling aircraft?
Grimes Posted January 30, 2023 Posted January 30, 2023 The fuel available to the tanker to refuel other aircraft is the same fuel pool used to fly the aircraft. A KC-135 can be in the air for better part of half a day if it doesn't need to refuel anyone. The RTB threshold depends on how far away the AI is from the airbase they are set to land at. As a result it varies with no hard number. I like to send them back at roughly 15% fuel because that is usually plenty to get back and the automatic RTB behavior often leaves very little wiggle room. In testing I had an E-2 do a case 3 approach and landed with a getFuel value of 0.0015. Also you can't give orders to the AI when they RTB automatically so any flexibility is lost. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
TEMPEST.114 Posted January 31, 2023 Author Posted January 31, 2023 2 hours ago, Grimes said: The fuel available to the tanker to refuel other aircraft is the same fuel pool used to fly the aircraft. A KC-135 can be in the air for better part of half a day if it doesn't need to refuel anyone. The RTB threshold depends on how far away the AI is from the airbase they are set to land at. As a result it varies with no hard number. I like to send them back at roughly 15% fuel because that is usually plenty to get back and the automatic RTB behavior often leaves very little wiggle room. In testing I had an E-2 do a case 3 approach and landed with a getFuel value of 0.0015. Also you can't give orders to the AI when they RTB automatically so any flexibility is lost. So how do I work out how many lbs of fuel it has that is ‘consumable’? There doesn’t seem to be anything in getDesc() about fuel, and a float doesn’t tell me how many lbs it has at 100% in order to do some maths in it. is this something missing from the api?
TEMPEST.114 Posted January 31, 2023 Author Posted January 31, 2023 3 hours ago, Grimes said: The fuel available to the tanker to refuel other aircraft is the same fuel pool used to fly the aircraft. A KC-135 can be in the air for better part of half a day if it doesn't need to refuel anyone. The RTB threshold depends on how far away the AI is from the airbase they are set to land at. As a result it varies with no hard number. I like to send them back at roughly 15% fuel because that is usually plenty to get back and the automatic RTB behavior often leaves very little wiggle room. In testing I had an E-2 do a case 3 approach and landed with a getFuel value of 0.0015. Also you can't give orders to the AI when they RTB automatically so any flexibility is lost. How are you calculating fuel consumption based in distance/altitude/pressure etc? There is no ‘flow flow’ we can grab in a MP environment is there?
Grimes Posted January 31, 2023 Posted January 31, 2023 getFuel() * getDesc().desc.fuelMassMax gives the weight in kg. https://github.com/mrSkortch/DCS-miscScripts/blob/master/ObjectDB/Aircraft/KC-135.lua#L29 I've only "calculated" fuel flow with regard to testing whether or not AI are getting fuel during AAR correctly. All that consisted of was comparing the difference of getFuel every few seconds to get the flow. I haven't tried to estimate fuel consumption during normal flight at different speeds and altitudes. Hence the general cutoff of % fuel remaining that in most cases is well above bingo and "auto AAR" thresholds. 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
TEMPEST.114 Posted January 31, 2023 Author Posted January 31, 2023 (edited) Thanks @Grimes You've given me enough to unblock me. I had no idea what that MassMax was... there's quite a bit in the getDesc() that isn't intuitive or clear. Edited January 31, 2023 by Elphaba
rob10 Posted February 26, 2023 Posted February 26, 2023 On 1/30/2023 at 8:50 PM, Grimes said: getFuel() * getDesc().desc.fuelMassMax gives the weight in kg. https://github.com/mrSkortch/DCS-miscScripts/blob/master/ObjectDB/Aircraft/KC-135.lua#L29 Using FuelStatus = Unit.getByName('S-3'):getFuel() gets me the fuel % but I can't figure out getting the total fuel. Trying FuelTotal = Unit.getByName('S-3'):getDesc().desc.fuelMassMax gives me an error. S-3 in this case is what the unit name is defined as (as well as being the aircraft type. I'm sure I'm missing something simple on the syntax, but I'm lost. Any suggestions?
Grimes Posted February 27, 2023 Posted February 27, 2023 Try: FuelTotal = Unit.getByName('S-3'):getDesc().fuelMassMax The files on the objectDB github can contain multiple return values from functions. Think of it as this: local unit = {} unit.ammo = obj:getAmmo() unit.sensors = obj:getSensors() unit.desc = obj:getDesc() 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
rob10 Posted February 27, 2023 Posted February 27, 2023 2 hours ago, Grimes said: Try: FuelTotal = Unit.getByName('S-3'):getDesc().fuelMassMax The files on the objectDB github can contain multiple return values from functions. Think of it as this: Thanks Grimes! That did the trick. It's hard to find good examples of exactly how these commands should be formatted. Probably gets easier with a better understanding but as a newby it's a fair bit of trial and error.
Recommended Posts