Author Topic: Release: FS AI Tools for VS Code  (Read 1945 times)

JakobT

  • Newbie
  • *
  • Posts: 11
    • View Profile
Release: FS AI Tools for VS Code
« on: June 16, 2021, 06:51:11 PM »
FS AI Tools


I'm happy to present of my FS AI Tools extension for VS Code. This is a project I started for my own AI workflow, allowing me to easily speed up flightplan installation, editing as well as cleaning of several FS related files. Since its inception, I've added a lot of features as well as options to make it possible to configure it to the user's own liking, so at this point I feel it might have some value to release it publicly.





Why is this needed?
Well, it's not needed per se. I started building it because I was lazy, and installing/editing FS flightplans and aircraft can be very repetitive and unnerving. That can be little stuff like changing AC#s, and bigger like cleaning up config files, or installing or deleting textures. At the same time, I hate having to switch between different programs to do stuff that's all related. I like editing my flightplans in VS Code and being able to clean/format/install from the very same where I already am without having to open files in 3 different programs.

TLDR: If you manually edit and install flightplans, aircraft etc., this extension offers time-saving capabilities because it does much of the tedious work for you.





Features
This is a short overview, for details check out the repository: FS AI Tools @ GitHub. All settings described can be configured, turned on or off.

  • Airline View: Displays a custom view that shows airline data such as the logo, ICAO code, callsign, author, season, visited airports, all segments (sortable by count or distance) as well as used aircraft types and an semi-interactive routemap (each aircraft type can be toggled on/off).

  • Clean Aircraft.cfg: can renumber fltsim.x entries, remove unwanted lines like atc_id_color, atc_heavy=0 etc., and sort lines per entry. Available only in aircraft.cfg files.
  • Clean Flightplan: can add leading zeroes to flightnumbers and flight levels, add "@" to arrival times, remove seconds from flight times, exchange "old" airport codes to new ones, randomize or streamline percentages and more. Available only in flightplans.txt files.
  • Change AC# Number: can change the AC#s of selected lines by a user specified amount. (Read: "Add 37 to these 3 aircraft numbers, please"). Available in both flightplans.txt and aircraft.txt files.
  • Count Aircraft: Counts the aircraft in each block (started by a "//Aircraft name" headline, and separated by a configure number of empty lines) and appends that count to the headline in form of "[count]". Available only in flightplans.txt files.
  • Convert to weekly flightplan: Converts flightplans with repeating periods of 24hr and below (12hr, 8hr, ...) to weekly flightplans ("WEEK"). Available only in flightplans.txt files.
  • Create aifp.cfg: Uses the Flightplan Header (custom data at the beginning of the flightplans.txt file - see "Create Flightplan header") data and creates an aifp.cfg file with that data. If the file already exists, all content will be overwritten. Available only in flightplans.txt files.
  • Create Aircraft: From a selected list of registrations, creates texture folders and fltsim entries for each and adds them automatically to a selected aircraft. Uses fltsim block template files. This can make a 30 minute job a 10 second joyride.
  • Create Flightplan Header: Uses a series of text input boxes to create a header with flightplan data (name, icao, callsign, author, season and/or FS version). Tries to read the airline name and ICAO code from the filename. Available only in flightplans.txt files.
  • Create Flightplan Header from aifp.cfg: Reads the data from an aifp.cfg file in the same directory (if present), and uses that data to create the header for the current flightplan file. Available only in flightplans.txt files.
  • Generate Airports: Extracts the airports from a Flightplans.txt file, and uses an airports master file (containing every possible airport entry) to create this flightplan's Airports.txt file. This is basically the functionality of the famous GenAir.exe. Available only in flightplans.txt files.
  • Group by Aircraft Type: Matches all aircraft to aircraft types, then groups them by those aircraft types, optionally sorts by wingspan, and outputs the list which each group separated by a defined number of empty lines. Additionally, when using this command in a Flightplans….txt file, adds aircraft name and livery variation comments before each block.

  • Rebase AC# Numbers: This is probably my absolute favorite one. Can change the AC#s of selected lines to a new start number, with customizable distance between aircraft and aircraft block. (Read: "Start these aircraft at 12500, with every new aircraft 1 higher than the last, and every new block in steps of 10"). Available in both flightplans.txt and aircraft.txt files.
  • Rename Files: Renames the flightplan files ("Aircraft…", "Airports…", "Flightplans…") in the current file's folder to a pre-defined pattern. The pattern can hold different placeholders ({name}, {icao} etc.), which will then be replaced with user-input data. Example: {Base}_{season?_}{icao?_}{name} will become Flightplans_Wi2021_AAL_American Airlines.txt, and respectively Aircraft… and Airports….
  • Renumber add-ons.cfg / Renumber scenery.cfg: Simply renumbers the [Package.x], [Area.xxx], Layer=x entries sequentially. Available in add-ons.cfg / scenery.cfg files.
  • Replace aircraft in other flightplan: Replaces aircraft with the same registration in a different flightplan and with the ones from current flightplan file. Ignores aircraft whose registrations don't match. This is basically the same functionality as "Match AC#s", but includes copying the aircraft over to the target flightplan file.
  • Show aircraft list: Goes through the Aircraft.txt and Flightplans.txt file and displays a list of used aircraft types, their count, and the number of variations.

    Note: The "Copy for Google Sheets" button is hidden behind a dev flag, as it creates custom data for my own AI Excel sheet and is thus unusable for other users.
  • Switch FS9 ⟷ FSX: Changes the selected flightplans' days from FS9 to FSX or vice versa. Change direction can be selected each time.



General Notes
  • All of the functions are based on how I prefer and use the AI files. I've tried to include as much customizability as possible, but
  • A handful of those functions uses the matching of aircraft titles used in the aircraft.txt file to actual aircraft types. Depending on how you've set up your AI system, this can work better or worse. I have created a base file to define those matching patterns, and additional data can be added /  existing data can be overwritten with a custom file. I will elaborate further on this and provide said file in the future. As of now, note that a full aircraft name including manufacturer must be in the title, e.g. "TFS Airbus A380-800 EA DLH-Lufthansa".
  • I'm open to any questions and suggestions. If you have thoughts on the implementation itself, improvements etc.: this is a 100% TypeScript project (with a twinkle of HTML and CSS for the Airline View), and the code is available at GitHub.
« Last Edit: January 19, 2023, 10:35:24 AM by JakobT »

JakobT

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Release: FS AI Tools for VS Code
« Reply #1 on: January 19, 2023, 10:29:22 AM »
Hey all. It's been a while since I posted about this extension initially, and I've since extended and optimized a lot of features, as well as added new ones. I've completely updated the initial post with all features and descriptions.

If you're interested, check out the feature overview or head directly to the repo's wiki for a detailed description of each feature, as well as requirements and installation instructions.
« Last Edit: January 19, 2023, 10:35:37 AM by JakobT »

jhaley101

  • Hero Member
  • *****
  • Posts: 1236
    • View Profile
Re: Release: FS AI Tools for VS Code
« Reply #2 on: January 26, 2023, 04:15:36 AM »
Thanks, I'll have a look!

John