Bogey Jammer Posted October 6, 2016 Share Posted October 6, 2016 (edited) Hello all :D 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 :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 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) 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 :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. 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. 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… 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. 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.luarun BJSDFPP shared west general.luarun BJSDFPP shared east general.luarun BJSDFPP west general.luarun BJSDFPP east general.luaBJ's SD flight plan page.lua Edited August 13, 2017 by Bogey Jammer FIRST RELEASE YEAAAAH!!!! 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 More sharing options...
Zaz0 Posted October 6, 2016 Share Posted October 6, 2016 great! waiting for it! Link to comment Share on other sites More sharing options...
CHSubZero Posted October 6, 2016 Share Posted October 6, 2016 Very nice idea! My Mods: DCS User Files Modules owned: EVERY Module :pilotfly: Link to comment Share on other sites More sharing options...
ESAc_matador Posted October 7, 2016 Share Posted October 7, 2016 Very nice idea! Very interesting! Link to comment Share on other sites More sharing options...
Bogey Jammer Posted October 7, 2016 Author Share Posted October 7, 2016 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 More sharing options...
AlaskanGrizzly Posted October 7, 2016 Share Posted October 7, 2016 (edited) 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 October 7, 2016 by AlaskanGrizzly Link to comment Share on other sites More sharing options...
MikeMikeJuliet Posted October 9, 2016 Share Posted October 9, 2016 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. DCS Finland | SF squadron Link to comment Share on other sites More sharing options...
Bogey Jammer Posted October 10, 2016 Author Share Posted October 10, 2016 Done, see the first post. Thanks to MikeMikeJuliet for the pertinent suggestions. Time to go to bed 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 More sharing options...
zbmtwo Posted October 11, 2016 Share Posted October 11, 2016 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! Link to comment Share on other sites More sharing options...
Bogey Jammer Posted October 12, 2016 Author Share Posted October 12, 2016 (edited) 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 November 16, 2016 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 More sharing options...
toby23 Posted August 5, 2017 Share Posted August 5, 2017 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 More sharing options...
Bogey Jammer Posted August 6, 2017 Author Share Posted August 6, 2017 (edited) 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 August 6, 2017 by Bogey Jammer 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 More sharing options...
toby23 Posted August 6, 2017 Share Posted August 6, 2017 http://www.fsfiles.org/flightsimshotsv2/ Can you post those images? Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
toby23 Posted August 6, 2017 Share Posted August 6, 2017 (edited) 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 Edited August 6, 2017 by toby23 got it working.. Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
Bogey Jammer Posted August 8, 2017 Author Share Posted August 8, 2017 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 More sharing options...
toby23 Posted August 8, 2017 Share Posted August 8, 2017 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 More sharing options...
toby23 Posted August 8, 2017 Share Posted August 8, 2017 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. Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
toby23 Posted August 8, 2017 Share Posted August 8, 2017 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 > Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
Chump Posted August 8, 2017 Share Posted August 8, 2017 Awesome concept! Thanks for the hard work put into this. :) Link to comment Share on other sites More sharing options...
Bogey Jammer Posted August 8, 2017 Author Share Posted August 8, 2017 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 More sharing options...
toby23 Posted August 8, 2017 Share Posted August 8, 2017 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 More sharing options...
Bogey Jammer Posted August 12, 2017 Author Share Posted August 12, 2017 Enjoy the new 1.1 version :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 More sharing options...
toby23 Posted August 12, 2017 Share Posted August 12, 2017 You're such a perfectionist Bogey (2.2369362920544 lol) Thanks a lot for updating this, it's one of the best tools. Much appreciated Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
toby23 Posted August 12, 2017 Share Posted August 12, 2017 (edited) 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 August 12, 2017 by toby23 Ryzen 5800X, 32GB RAM, RTX 3060 Link to comment Share on other sites More sharing options...
Bogey Jammer Posted August 12, 2017 Author Share Posted August 12, 2017 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 More sharing options...
Recommended Posts