I have been unable to utilize GetOxygenLevel() to obtain the fill % from a Hydrogen (or oxygen) tank. Here is what I have been trying:
The goal is to obtain all tanks (I can narrow it down to hydrogen only later) in an array and then average their "GetOxygenLevel()"s to find a...
Obtaining Filled % from a tank
Code:
void Main(string argument) { var tankArray = new List<IMyTerminalBlock>(); GridTerminalSystem.GetBlocksOfType<IMyOxygenTank>(tankArray); float fillPercentage = tankArray[0].GetOxygenLevel(); }
Obtaining Filled % from a tank