BJ's semi-dynamic flight plan kneeboard page - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 10-06-2016, 09: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, 75 views)
File Type: lua run BJSDFPP shared west general.lua (127 Bytes, 77 views)
File Type: lua run BJSDFPP shared east general.lua (155 Bytes, 76 views)
File Type: lua run BJSDFPP west general.lua (78 Bytes, 78 views)
File Type: lua run BJSDFPP east general.lua (78 Bytes, 83 views)
File Type: lua BJ's SD flight plan page.lua (28.6 KB, 49 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 01:55 PM. Reason: FIRST RELEASE YEAAAAH!!!!
Bogey Jammer is offline   Reply With Quote
Old 10-06-2016, 09:30 PM   #2
Zaz0
Member
 
Zaz0's Avatar
 
Join Date: Jan 2012
Posts: 214
Default

great! waiting for it!
Zaz0 is offline   Reply With Quote
Old 10-06-2016, 09:31 PM   #3
CHSubZero
Senior Member
 
CHSubZero's Avatar
 
Join Date: Oct 2010
Location: Ebmatingen ZH
Posts: 1,170
Default

Very nice idea!
__________________
My Mods: DCS User Files
CHSubZero is offline   Reply With Quote
Old 10-07-2016, 02:53 AM   #4
ESAc_matador
Senior Member
 
Join Date: Aug 2007
Posts: 1,553
Default

Quote:
Originally Posted by CHSubZero View Post
Very nice idea!



Very interesting!
ESAc_matador is offline   Reply With Quote
Old 10-07-2016, 11:43 AM   #5
Bogey Jammer
Member
 
Bogey Jammer's Avatar
 
Join Date: Jul 2015
Location: France
Posts: 514
Default

Cool, looks like it's already loved

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 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.
Bogey Jammer is offline   Reply With Quote
Old 10-07-2016, 01:09 PM   #6
AlaskanGrizzly
Member
 
AlaskanGrizzly's Avatar
 
Join Date: Dec 2010
Location: United States
Posts: 405
Default

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.
Attached Files
File Type: lua nevada-navbeacons-001.lua (5.2 KB, 61 views)

Last edited by AlaskanGrizzly; 10-07-2016 at 01:12 PM.
AlaskanGrizzly is offline   Reply With Quote
Old 10-09-2016, 02:11 PM   #7
MikeMikeJuliet
Senior Member
 
Join Date: Jan 2016
Location: Finland
Posts: 1,176
Default

You might want to format the altitude for each leg so, that if it is less than 1km, it would show meters (so 0 to 999m) and a kilometer format from 1km upwards.
MikeMikeJuliet is offline   Reply With Quote
Old 10-10-2016, 11:55 PM   #8
Bogey Jammer
Member
 
Bogey Jammer's Avatar
 
Join Date: Jul 2015
Location: France
Posts: 514
Default

Done, see the first post.
Thanks to MikeMikeJuliet for the pertinent suggestions.
Time to go to bed
__________________
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.
Bogey Jammer is offline   Reply With Quote
Old 10-11-2016, 10:49 PM   #9
zbmtwo
Junior Member
 
zbmtwo's Avatar
 
Join Date: May 2016
Location: Australia
Posts: 22
Default

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:



Keep up the great work!
zbmtwo is offline   Reply With Quote
Old 10-12-2016, 05:50 PM   #10
Bogey Jammer
Member
 
Bogey Jammer's Avatar
 
Join Date: Jul 2015
Location: France
Posts: 514
Default

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 . 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.
__________________
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; 11-16-2016 at 10:31 AM.
Bogey Jammer is offline   Reply With Quote
Reply

Tags
dynamic, flightplan, kneeboard, lua, scripting

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 12:42 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.