Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-30-2011, 10:12 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default getParameter - extended DeviceLink replacement

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)
Code:
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_VelocityIAS, -1); // get TAS and alt.
              double i_IAlt = curPlane.getParameter(part.ParameterTypes.I_Altitude, -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();
          }
      }
}

}
Attached Files
File Type: zip GetParameterParameters.zip (6.9 KB, 143 views)

Last edited by Ataros; 10-05-2011 at 08:43 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.