Jump to content

BJ's semi-dynamic flight plan kneeboard page


Bogey Jammer

Recommended Posts

Hello all :D

 

Introducing my semi-dynamically generated flight plan page:

 

57d76e16aebaf5d9d7e32d82c8bfe94f.png

 

2e650eb17bb9aa05f50248c2f7862150.png

 

It is a lua script generating the player's flight plan (and related information) when the page is loaded. It remains static during the mission's run, that's why I specify it as semi-dynamic.

 

It allows customization of the displayed data (units, annotations, table, sizes, colors, margins…). So it is possible to duplicate the script file with different settings to display pages with different contents, allowing the dilution of annotations that can very easily overlap when waypoints are close together.

 

The script is attached to this post along some examples of calling files (read the installation procedure to learn what I'm talking about). The current version is 1.1

 

CHANGELOG:

 

V1.1:

-- Added MPH speed unit availability

-- Added distances between waypoints calculation

-- Added SHOW_SEGMENT_SPEED settings

-- Added SHOW_SEGMENT_DISTANCE settings

-- Slight enhancement of waypoints' annotations visibility

-- Added basic collision management for overlapping segment annotations

 

V1.0:

-- Initial release

 

WARNING:

  • The script doesn't work in multiplayer mode since this mode uses a different way to store mission's temporary data. Moreover, the player's chosen flight is not specified in this data and is to be determined by a yet unknown method.
  • Since I don't own the Nevada TTR terrain, I've never tested the script for this terrain and I've currently blindly wrote compatibility code. Let me know how its going on this map,
  • Consider this script as a WIP. Significant enhancements can come from public's ideas so feel free to suggest here.

 

INSTALLATION INSTRUCTIONS:

 

Reminder of the DCS's custom kneeboard system

 

If you don't know yet, DCS allows user to display customized pages into the in-game kneeboard, sorted by aircraft. Usually these pages are static pictures, but the system can execute lua code for dynamic content. All the custom files are located here:

 

%USERPROFILE%\Saved Games\DCS\Kneeboard

 

(Just type it in the windows' explorer address bar to go there)

Now there should be directories named after all the aircrafts you can fly in DCS (if missing, create them, the names must match their counterparts in Program Files/DCS World/Mods/aircraft except for Flaming Cliffs aircrafts that are seperated in the kneeboard directory…)

Then in each of these aircraft directories, you have to put your custom kneeboard pages.

 

Philosophy of the BJ's flight plan page file layout

 

Instead of duplicate the same whole script in every aircraft folder, we will utilize the ultra convenient feature of lua consisting to have just ONE main script file and call it from each aircraft with just two lines of code. This way it will be much easier to update the script (just one file to replace), and to setup the displayed pages because it will require to write the only settings that differ from the default ones stored in the main file.

BUT, that is still too cumbersome for me, so I prepared a more extreme organization. Let's say you have 50 western aircraft modules and 80 eastern aircraft modules (DCS in 2-3 weeks :lol:) Will you replace the same calling file with respecting settings 130 times if you mistaken a single setting ? hell no. So these settings can also shared in another intermediate file, resulting of a single line of code in each aircraft for calling these shared settings files. Just like Cascading Style Sheet. There is still need to create 130 lua files for this single line of code :doh:, but they will never be touched again :thumbup:

However some aircrafts may have specific settings (like the MiG-21bis with its kneeboard exotic dimensions), so a caller file with its own settings must be created for each of these aircrafts.

 

The procedure

 

  1. Inside the kneeboard folder, create a new folder called Shared, then put the BJ's SD flight plan page.lua file inside it (this file is attached to this post)
  2. Open this file with your favorite text editor (no text processor), and look for the localization parameters:
     
    0fdc512814b1b2a00fe1fb1c05efe414.png
     
    These localization parameters tell the script to display the various mission's texts in the specified language if the mission maker created them.
    Modify these two parameters according to your needs:
     
    c510065e00a6d40954272fe4ee548206.png
     
    I purposely let these settings to detect anyone who haven't RTFM :devil: (sauf s'ils parlent déjà Français…)
     
    In the future you may have to change some of these default settings in the same way. They are common to all aircrafts and overridden by the ones provided by the calling scripts.
  3. Let's create a calling file for the MiG-21bis. Create a new file inside the MIG-21bis folder with .lua extension and any name. Edit the file and copy/paste the following lines:
     
    dofile(lfs.writedir().."Kneeboard/Shared/BJ's SD flight plan page.lua")
    BJSDFPP{
       UNIT_ALTITUDE="km",
       UNIT_SPEED="kmh",
       SIZE_WP_NUMBER=0.002,
       SIZE_WP_DISCRATIO=15,
       SIZE_ANNOTATIONS=0.002,
       SIZE_TABLE_TEXT=0.0025,
       SIZE_TABLE_CELLRATIO=19,
       SHOW_SEGMENT_ANNOTATIONS=false,
       SHOW_WP_ETA=false,
       SHOW_WP_NAME=false,
       SHOW_BEACONS=false,
       SHOW_SEGMENT_SHORTTHRESHOLD=0.33,
       SHOW_SEGMENT_HIDETHRESHOLD=0.17,
       }

    (or download run BJSDFPP MiG-21 table.lua attached to this post)
    This will call the main script and override the specified parameters to fit the flight plan inside the non-standard dimensions of the MiG-21bis' kneeboard. Note that the text size unit is unrelated to the page's unit system. So we have to configure all these parameters to show the flight plan page properly without any glitches. I personally don't use any third-party kneeboard modifying application, so that issue may apply to anybody altered the default kneeboard's dimensions as well.

  4. Now we will create a shared intermediate calling file. Inside the Shared directory, create a new file named run BJSDFPP shared west general.lua. Edit the file and copy/paste the following lines:
     
    dofile(lfs.writedir().."Kneeboard/Shared/BJ's SD flight plan page.lua")
    BJSDFPP{
       UNIT_ALTITUDE="kft",
       UNIT_SPEED="kn",
       }

    (or download run BJSDFPP shared west general.lua attached to this post)
    This is the common calling script that will be called by the 50 western aircrafts you will own sooner or later…

  5. And, inside one of the western aircraft, create a new file with .lua extension and with any name you want. Edit this file and copy/paste the following line:
     
    dofile(lfs.writedir().."Kneeboard/Shared/run BJSDFPP shared west general.lua")

    (or download run BJSDFPP west general.lua attached to this post)
    Then copy this file into any other aircraft that must use the same shared settings.

  6. You can place many calling files as you wish inside one aircraft folder, there will be as many kneeboard pages generated.

 

I hope this was not too hard, but life ain't easy…

run BJSDFPP MiG-21 table.lua

run BJSDFPP shared west general.lua

run BJSDFPP shared east general.lua

run BJSDFPP west general.lua

run BJSDFPP east general.lua

BJ's SD flight plan page.lua


Edited by Bogey Jammer
FIRST RELEASE YEAAAAH!!!!
  • Like 2

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

Cool, looks like it's already loved :D

 

But, bad news, I can't make it work for multiplayer missions yet. Unlike singleplayer missions, the DCS's way of putting multiplayer temporary mission data is not as straightforward and clear. I still can manage to load the data but I'm not able to know what flight the player chooses.

There is still hope, a solution may be found by extensive reverse engineering.

 

I'd also like to make my script compatible with the Nevada TTR map that I don't own. So I ask if anybody can send me via PM a temporary singleplayer mission using the map (or simply give me the value for the ["theatre"] keyword inside the mission file). This mission file is generated at: C:\Users\*username*\AppData\Local\Temp\DCS\Mission and is just called "mission" without extension. However it only exists while the mission is running, so get a copy before you exit the mission.

I'd also like to check the Beacons.lua file for the Nevada map (if it exists). That file should be located at: C:\Program Files\Eagle Dynamics\DCS World\Mods\terrains\*nevadasubfolder*\ Also, communicate me that *nevadasubfolder* name because my script indeed needs it to read the Beacons.lua file…

Thx in advance

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

Here is my Nevada beacon dynamic page. It has the directory path to the Nevada Beacons and may be of some help in other ways as well.

 

If you have a chance could you let me know how the multiplayer temp mission data works. I never did figure out how that worked after the 1.5 and 2.0 updates.

nevada-navbeacons-001.lua


Edited by AlaskanGrizzly
Link to comment
Share on other sites

Fantastic work BJ, thank you very much! Ever since I saw the work Emolina had done with the "Interesting Mission Generator" (particuarly the kneeboard flight plan for each mission) I had been wondering how to generate a flightplan from the MIZ file using LUA.

 

Have you seen the format Emolina used for the flight plan table? I think it could make a great addition to your already excellent graphical representation:

 

kneeboard_flight_plan.png

 

Keep up the great work!

Link to comment
Share on other sites

Thanks for the appreciation.

 

Everything would be nice to add. I actually need that sort of frequency remainder dynamically generated. However there are some choices to make, like the use of the room available to add more information in the table without scaling down the font too aggressively. There is another problem. We virtual pilots have the tendency to put waypoints on beacons to fly a route directly above them to get the simplest navigation management as possible. It's OK for crowded heavy VFR civilian traffic but on the battlefield I'd place a SAM near each these overused beacons by the enemy :devil:. Real pilots use the clock and anemometer for off-road navigation. Beacons are used to materialize FIX points with the help of radials. That is advanced flight route planning and it is impossible for a script to guess that sort of pilot thinking and write down the corresponding directions.

 

Instead, I will make another scripted page, more oriented to the mission itself, with a resume of all possible frequencies that are to be used in the mission's area, accorded to the aircraft's radio equipment and presets, + a script listing all the aircraft's radio presets and the corresponding beacon/station. This plus beacon graphic representation would help the pilot to pick the frequency according to the way they intended to follow.


Edited by Bogey Jammer

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

  • 9 months later...

I must be getting too old for this but I cannot make this work.

I would really be happy if this created a page in the kneeboard with a simple waypoint route overview for each mission.

As I can't see the briefed route on the map inside a mission, it would be great to have on the kneeboard.

I've followed the instructions but nothing happens when I start a mission, do I need to download something else?

Thanks,

Toby

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

Hello Toby,

 

There is nothing else to download, the script uses DCS original features only. The main critical thing to do is putting the script file in the correct aircraft's kneeboard directory to make it work. Just use the main script file (the first one to download) for testing. If the directory is correct, the flight plan should appear just fine in the kneeboard.

 

EDIT: All the pictures included in the first post are dead. Photobucket is unreliable. I must find another image host.


Edited by Bogey Jammer
  • Like 1

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

I got it working, perfect for following my flightplan in the campaign.

 

Is there a way to make it add the distances instead of the speed? HDG and Distance are more relevant for helicopter missions, not altitude or speed.

 

To get it working in the Mi-8MTV2, I needed to use the abbreviation Mi-8M for the Kneeboard aircraft folder.

 

Thanks a million for this tool,

Toby

 

DCS-2017-08-06-20-06-42.jpg


Edited by toby23
got it working..

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

http://www.fsfiles.org/flightsimshotsv2/

 

Can you post those images?

 

Thanks for this link, I'll try it out once I get some free time. Glad to see this is useful for you, but as a Mi-8 pilot, I think it will be even more useful if I make the script to display distances between waypoints for a more convenient doppler navigation setup :D

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

No need to subtract the magnetic deviation, if that's what you mean.

It just would be great to have heading and distance on each section instead of heading and speed, maybe even an option for all three but distance is the most important, for setting the doppler system.

 

Thanks, this is a really fantastic tool.

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

After playing around with the editing, I have created a set to show speed in mph, for the P-51D and Spitfire, that excludes beacons. Now all that's missing is an option to show distance between waypoints for the Mi-8!

 

Thanks again for this awesome tool.

 

Screen_170808_145701.jpg

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

One more question, for now...

 

What needs to be changed in the code below to show only Heading and Altitude on the Segments?

 

add_text_ext(string.format("%s %s %s\n%s", bearingL, convert_speed(wp2.speed), bearingR, altitude_text), posX, posY, FONT_BLACK, SIZE_ANNOTATIONS, "CenterCenter", rotation) elseif WPmap_distance >

 

DCS-2017-08-08-16-15-40.jpg

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

No need to subtract the magnetic deviation, if that's what you mean.

It just would be great to have heading and distance on each section instead of heading and speed, maybe even an option for all three but distance is the most important, for setting the doppler system.

 

Yep, distances for doppler system, that is what I mean exactly :)

 

After playing around with the editing, I have created a set to show speed in mph, for the P-51D and Spitfire, that excludes beacons.

Beacons can be hidden, but I didn't think about mph speed unit at all. To the todo list then :geek:

 

One more question, for now...

 

What needs to be changed in the code below to show only Heading and Altitude on the Segments?

Try that :

add_text_ext(string.format("%s %s\n%s", bearingL, bearingR, altitude_text), posX, posY,  FONT_BLACK, SIZE_ANNOTATIONS, "CenterCenter", rotation)

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

Try that :

add_text_ext(string.format("%s %s\n%s", bearingL, bearingR, altitude_text), posX, posY,  FONT_BLACK, SIZE_ANNOTATIONS, "CenterCenter", rotation)

 

That works exactly as I had hoped, thanks.

 

Here's the mph section

 

elseif UNIT_SPEED == "mph" then

return round(speed * 2.23694).." mph"

end

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

add_text_ext(string.format("%s%s\n%s", bearingL, bearingR, distance_text), posX, posY, FONT_BLACK, SIZE_ANNOTATIONS, "CenterCenter", rotation)

 

EDIT - I solved my problem. The text above shows only Heading and Distance on the Route Sections, if anyone else needs it..


Edited by toby23

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

You're such a perfectionist Bogey (2.2369362920544 lol)

It's from Chump :thumbup:

I dunno where he found that coef but it looks cooler than Wikipedia's :smoke:

I'll buy :

МиГ-23МЛД & МЛА МиГ-27К МиГ-25 Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...