Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

Obtaining Filled % from a tank

$
0
0
I have been unable to utilize GetOxygenLevel() to obtain the fill % from a Hydrogen (or oxygen) tank. Here is what I have been trying:
Code:
void Main(string argument)
{
	var tankArray = new List<IMyTerminalBlock>();  
	GridTerminalSystem.GetBlocksOfType<IMyOxygenTank>(tankArray);
  
	float fillPercentage = tankArray[0].GetOxygenLevel();
}
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

Viewing all articles
Browse latest Browse all 645

Trending Articles