Ataros
09-30-2011, 10:12 AM
Attached is a list of parameters that can be inquired by a script from the CloD engine as in the following example:
float health = (float)aircraft.getParameter(part.ParameterTypes.M _Health, -1);
This allows creation of instruments panels on external monitors, virtual cockpits, etc.
Sample from naryv for offline use (prints out TAS and alt)
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
System.IO.FileInfo fi = new System.IO.FileInfo("indicators.txt");
System.IO.StreamWriter sw;
public override void OnTickGame() {
base.OnTickGame();
if (Time.tickCounter() % 30 == 1) // tick ~ 1/30 second, 30 ticks ~ 1 second
{
AiAircraft curPlane = GamePlay.gpPlayer().Place() as AiAircraft; // get player aircraft
if (curPlane != null)
{
double i_IAS = curPlane.getParameter(part.ParameterTypes.I_Veloci tyIAS, -1); // get TAS and alt.
double i_IAlt = curPlane.getParameter(part.ParameterTypes.I_Altitu de, -1);
System.Console.WriteLine("IAS :{0}", i_IAS); // write to console
System.Console.WriteLine("Alt :{0}", i_IAlt);
sw = fi.AppendText(); // write to file
sw.WriteLine("Time:{0}",Time.currentReal());
sw.WriteLine("IAS :{0}", i_IAS);
sw.WriteLine("Alt :{0}", i_IAlt);
sw.Close();
}
}
}
}
float health = (float)aircraft.getParameter(part.ParameterTypes.M _Health, -1);
This allows creation of instruments panels on external monitors, virtual cockpits, etc.
Sample from naryv for offline use (prints out TAS and alt)
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
System.IO.FileInfo fi = new System.IO.FileInfo("indicators.txt");
System.IO.StreamWriter sw;
public override void OnTickGame() {
base.OnTickGame();
if (Time.tickCounter() % 30 == 1) // tick ~ 1/30 second, 30 ticks ~ 1 second
{
AiAircraft curPlane = GamePlay.gpPlayer().Place() as AiAircraft; // get player aircraft
if (curPlane != null)
{
double i_IAS = curPlane.getParameter(part.ParameterTypes.I_Veloci tyIAS, -1); // get TAS and alt.
double i_IAlt = curPlane.getParameter(part.ParameterTypes.I_Altitu de, -1);
System.Console.WriteLine("IAS :{0}", i_IAS); // write to console
System.Console.WriteLine("Alt :{0}", i_IAlt);
sw = fi.AppendText(); // write to file
sw.WriteLine("Time:{0}",Time.currentReal());
sw.WriteLine("IAS :{0}", i_IAS);
sw.WriteLine("Alt :{0}", i_IAlt);
sw.Close();
}
}
}
}