1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-01-2012, 12:31 PM
Skoshi Tiger Skoshi Tiger is offline
Senior Member
 
Join Date: Nov 2007
Location: Western Australia
Posts: 2,196
Default Getting waypoint information using a script.

(edit there should be a questionmark in the thread title!)

Hi! I was wondering if there were any sample scripts that can access the details for each of the waypoints for a flight of planes (I'm interested in the current players aircraft specifically), or a list of the methods/data structures used to access and store the waypoints?


What I would be hoping to do would be to create a script that would be able to generate a simple flight plan showing the true course heading and distance for each of the legs of a players route.

Cheers!

Last edited by Skoshi Tiger; 01-01-2012 at 12:39 PM.
Reply With Quote
  #2  
Old 01-01-2012, 12:59 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

If you want to access the information by reading the mission file (i.e. before the mission was loaded) you can use some parts of IL2DCE.

The AirGroupWaypoint class allows access to the all parameters of one waypoint.
http://code.google.com/p/il2dce/sour...oupWaypoint.cs

To build a list of all waypoints of one air group you need to use this code:
Code:
// Waypoints
string Id = "AirGroupKey.SquadronIndexAndFlightMask";
List<AirGroupWaypoint>() Waypoints = new List<AirGroupWaypoint>();
for (int i = 0; i < sectionFile.lines(Id + "_Way"); i++)
{
    AirGroupWaypoint waypoint = new AirGroupWaypoint(sectionFile, Id, i);
    Waypoints.Add(waypoint);
}
Where the Id is the in a format of "BoB_LW_LG1_IV.37" so you need to remove the last digit that identifies the aircraft from the "Player" key of the [MAIN] section.

If you want to access further information from the air group you can also use the AirGroup class. http://code.google.com/p/il2dce/sour...CE/AirGroup.cs
However it has many dependencies that would have to be removed.

Hope it's understandable.
Reply With Quote
  #3  
Old 01-01-2012, 10:25 PM
Skoshi Tiger Skoshi Tiger is offline
Senior Member
 
Join Date: Nov 2007
Location: Western Australia
Posts: 2,196
Default

Banks! Thanks for a point in the right direction.

I'm still getting my head around C# (I have had a bit of exposure to C a long time ago but am very rusty!) so It'll give me something to keep me busy over my holidays!

Cheers!
Reply With Quote
  #4  
Old 02-10-2013, 12:34 PM
notimejeff notimejeff is offline
Approved Member
 
Join Date: Apr 2011
Location: Cardiff, Wales (Europe)
Posts: 34
Default NavPlan

there's a great utility in 1946 called NavPlan which does all that. Anyone up to producing same for CloD?
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:55 AM.

Based on a design by: Miner Skinz.com

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.