ED Forums - View Single Post - BJ's semi-dynamic flight plan kneeboard page
View Single Post
Old 10-06-2016, 08:11 PM   #1
Bogey Jammer
Member
 
Bogey Jammer's Avatar
 
Join Date: Jul 2015
Location: France
Posts: 514
Post BJ's semi-dynamic flight plan kneeboard page

Hello all

Introducing my semi-dynamically generated flight plan page:





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 ) 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 , but they will never be touched again
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:



    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:



    I purposely let these settings to detect anyone who haven't RTFM (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:

    Code:
    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:

    Code:
    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:

    Code:
    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…
Attached Files
File Type: lua run BJSDFPP MiG-21 table.lua (424 Bytes, 66 views)
File Type: lua run BJSDFPP shared west general.lua (127 Bytes, 67 views)
File Type: lua run BJSDFPP shared east general.lua (155 Bytes, 68 views)
File Type: lua run BJSDFPP west general.lua (78 Bytes, 72 views)
File Type: lua run BJSDFPP east general.lua (78 Bytes, 76 views)
File Type: lua BJ's SD flight plan page.lua (28.6 KB, 44 views)
__________________
I own :
FC3 МиГ-21бис МиГ-15бис Ми-8МТВ2 Mirage 2000C Ka-50 F-5E Bf109K-4 SA342 A-10C
I'll buy :
МиГ-23МЛД & МЛА МиГ-27К МиГ-25 F-14A Mirage III F-4E any IJ plane 1950' Korea Dynamic campaign module
Running DCS 1.5.8 until costs of hardware required to run 2.5 smoothly in VR mode drop to a reasonable level.

Last edited by Bogey Jammer; 08-13-2017 at 12:55 PM. Reason: FIRST RELEASE YEAAAAH!!!!
Bogey Jammer is offline   Reply With Quote