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

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 10-02-2011, 08:48 PM
bolox bolox is offline
Approved Member
 
Join Date: May 2008
Posts: 351
Default

thanks for this- made life alot easier to see how they've done things- there's many more 'parameters' to play with than old IL2 devicelink- very extended

i'm very new to this scripting lark but managed to get some bombsight parameters writing to screen

this does lead me to think that if any efforts are to be made in this direction there is a decision to be made with the output, i feel, there being a choice with separate instrument gauge and model instant values available for some params- chart makers will want one set, instrument replicators wanting another set- or start from scratch with a new protocol. any thoughts?
Reply With Quote
  #3  
Old 10-03-2011, 06:11 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Can this be used to create a speedbar like in IL2-1946? ie speed, altitude & heading?
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
  #4  
Old 10-03-2011, 07:10 PM
bolox bolox is offline
Approved Member
 
Join Date: May 2008
Posts: 351
Default

http://simhq.com/forum/ubbthreads.ph...ml#Post3347984

i;ve just changed a few things to read other params
Reply With Quote
  #5  
Old 10-05-2011, 08:38 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Updated the 1st message with a sample from naryv.
Reply With Quote
  #6  
Old 10-20-2011, 10:45 AM
KeBrAnTo's Avatar
KeBrAnTo KeBrAnTo is offline
Approved Member
 
Join Date: Feb 2010
Location: Madrid, SPAIN
Posts: 99
Smile

Great finding Ataros, now I've got the subject quite clear and I think with a litle bit of programming an interface it would be quite simple to make external gauges work, either in a second monitor or using phidgets I think.

I'll start coding a little bit tonite to see what are exactly the possibilities that open up doing the things like this.

Great news.
__________________
Former member of:
StG111 2003-2005 | SG1 2006-2009 | 15.Span 2010-2011


CPU Intel i7 920 @ 2.67 -> OC 4 Ghz MB ASUS P6T Cooler Noctua NH-D14 Memory 12GB
GPU 2x nVidia 285 GTX 1GB SLI HD 2x SATAII WD VelociRaptor 150GB RAID 0
SB ASUS Xonar DS/DT 7.1 PSU Tagan 1100W OS W7 Ult.64 LCD LG W2284F-PF
TrackIR 3 Pro + Saitek X-52 + Saitek Pro Rudders Pedals + Pro Flight Throttle Quadrant + Saitek PcDash 2

Last edited by KeBrAnTo; 10-20-2011 at 11:05 AM.
Reply With Quote
  #7  
Old 10-20-2011, 11:23 AM
KeBrAnTo's Avatar
KeBrAnTo KeBrAnTo is offline
Approved Member
 
Join Date: Feb 2010
Location: Madrid, SPAIN
Posts: 99
Default

Sorry, I think I've seen it in another of your posts Ataros, but I cannot find it now so could you please tell me which are the dll's containing the maddox.game namespace?

Thanks in advance.
__________________
Former member of:
StG111 2003-2005 | SG1 2006-2009 | 15.Span 2010-2011


CPU Intel i7 920 @ 2.67 -> OC 4 Ghz MB ASUS P6T Cooler Noctua NH-D14 Memory 12GB
GPU 2x nVidia 285 GTX 1GB SLI HD 2x SATAII WD VelociRaptor 150GB RAID 0
SB ASUS Xonar DS/DT 7.1 PSU Tagan 1100W OS W7 Ult.64 LCD LG W2284F-PF
TrackIR 3 Pro + Saitek X-52 + Saitek Pro Rudders Pedals + Pro Flight Throttle Quadrant + Saitek PcDash 2
Reply With Quote
  #8  
Old 10-20-2011, 11:40 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Do you mean this post?
Quote:
Visual Studio will let you see all of the methods in roundabout way. Try this:

1. File >> New >> Project Type in a name and solution name at the bottom. Don't worry about what kind of project you create.

2. On the right side under "Solution Explorer", right click on "References", "Add Reference..."

3. Click on the "Browse" tab, navigate to "Steam/steamapps/common/il-2 sturmovik cliffs of dover/parts/core"

4. Go through each .dll file in that list and try to add it. Some will give you an error, just skip those.

After you've added all the .dll files, right click on the name of your project and do "Add Existing Item". Find one of your script files and add it. Now Visual Studio will show you all the possible methods as you're typing your code. You can also go to View >> Object Browser and have a look in there.

Important: When you import an existing item, Visual Studio makes a copy of the file so any changes you make won't be reflected in the original file, you'll have to copy the new one over it. If anybody knows how to change this, I'd be quite grateful.
Reply With Quote
  #9  
Old 10-20-2011, 12:16 PM
KeBrAnTo's Avatar
KeBrAnTo KeBrAnTo is offline
Approved Member
 
Join Date: Feb 2010
Location: Madrid, SPAIN
Posts: 99
Default

Yes, thanks mate
__________________
Former member of:
StG111 2003-2005 | SG1 2006-2009 | 15.Span 2010-2011


CPU Intel i7 920 @ 2.67 -> OC 4 Ghz MB ASUS P6T Cooler Noctua NH-D14 Memory 12GB
GPU 2x nVidia 285 GTX 1GB SLI HD 2x SATAII WD VelociRaptor 150GB RAID 0
SB ASUS Xonar DS/DT 7.1 PSU Tagan 1100W OS W7 Ult.64 LCD LG W2284F-PF
TrackIR 3 Pro + Saitek X-52 + Saitek Pro Rudders Pedals + Pro Flight Throttle Quadrant + Saitek PcDash 2
Reply With Quote
  #10  
Old 01-18-2012, 01:59 PM
Tex-Twil Tex-Twil is offline
Approved Member
 
Join Date: Mar 2011
Posts: 63
Default

Quote:
Originally Posted by Ataros View Post
the following example:
Hi,
which programming language is this and what how do I make CoD execute it ?

EDIT: ok I got it. It's C#. But this works only for custom missions, right ? http://simhq.com/forum/ubbthreads.ph...3347984/2.html


thanks,
Tex

Last edited by Tex-Twil; 01-18-2012 at 02:14 PM.
Reply With Quote
Reply


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 08:34 PM.


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