npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fboes/aerofly-custom-missions

v1.0.4

Published

Builder for Aerofly FS4 Custom Missions Files

Downloads

15

Readme

Aerofly FS4 Custom Mission

Builder for Aerofly FS4 Custom Missions Files

Aerofly Flight Simulator 4 has a custom missions file custom_missions_user.tmc with a very unique format. To help you build this custom missions file, this JavaScript / TypeScript library offers Data Objects to create this file programatically.

This library is intended to work in modern browsers as well as Node.js.

Installation

Either download the dist/index.js to a sensible location in your web or Node.js project, or do a NPM installation:

npm install @fboes/aerofly-custom-missions --save

Instead of a local installation for your browser project you may also load the library from https://unpkg.com/. Beware: This makes https://unpkg.com/ a dependency of your project and may pose data protection issues.

<script type="module" src="https://unpkg.com/@fboes/aerofly-custom-missions@latest/dist/index.js"></script>

Everything required for the functionality of this library is contained in dist/index.js.

Usage

Loading the library prior to use:

// 1. NodeJS - NPM installation
import {
  AeroflyMissionsList,
  AeroflyMission,
  AeroflyMissionConditions,
  AeroflyMissionConditionsCloud,
  AeroflyMissionCheckpoint,
} from "@fboes/aerofly-custom-missions";

// 2. Local installation and/or browser usage
import {
  AeroflyMissionsList,
  AeroflyMission,
  AeroflyMissionConditions,
  AeroflyMissionConditionsCloud,
  AeroflyMissionCheckpoint,
} from "dist/index.js";

You might want to enable TypeScript type checking by adding // @ts-check as your first line in your scripts.

Basic idea

All objects are basic structures needed for the missions list. The constructors tell you which properties are required, and will start with sensible defaults for all other properties.

All objects can be exported as JSON or as string via the toString() methods. Exporting the AeroflyMissionsList via toString() gives you the complete source code for a valid custom_missions_user.tmc.

Building a missions file

A mission file contains one or multiple missions. Building this file starts with the outer container, wich contains the missions:

// Build a missions list
const missionList = new AeroflyMissionsList();

// You can now add missions to this `missionList`:
missionList.missions.push(new AeroflyMission("Mission 1"));
missionList.missions.push(new AeroflyMission("Mission 2"));

// Show output of actual missions file
console.log(missionList.toString());

Building a mission

A single mission needs multiple properties:

  • The aircraft, its position and state
  • The time and weather conditions
  • The actual flight plan
// Build time and weather
const conditions = new AeroflyMissionConditions({
  time: new Date(),
  wind: {
    direction: 190,
    speed: 11,
    gusts: 22,
  },
  visibility: 25000,
  clouds: [new AeroflyMissionConditionsCloud(0.1, 1524), new AeroflyMissionConditionsCloud(0.2, 2286)],
});

// Build checkpoints
const checkpoints = [
  new AeroflyMissionCheckpoint("KCCR", "origin", -122.057, 37.9897),
  new AeroflyMissionCheckpoint("19L", "departure_runway", -122.055, 37.993),
  new AeroflyMissionCheckpoint("24", "destination_runway", -70.607, 41.399),
  new AeroflyMissionCheckpoint("KMVY", "destination", -70.6139, 41.3934),
];

// Build mission
const mission = new AeroflyMission("From Concord to Martha's Vineyard", {
  aircraft: {
    name: "c172",
    icao: "C172",
    livery: "",
  },
  checkpoints,
  conditions,
});

// Build mission list
const missionList = new AeroflyMissionsList([mission]);

// Show output of actual missions file
console.log(missionList.toString());

As there are lots of properties for the mission object, check the type hinting on the various objects to find out which properties you are able to set.

Important notices

  • Be aware that mission.origin and mission.destination do not need to match the flight plan. In case of origin you may want to set the position to the actual parking position of your aircraft, which may not be the first way point in your flight plan.
  • Flight plans almost always require at least 4 checkpoints:
    • origin
    • departure_runway
    • destination_runway
    • destination
  • Be aware that all units for altitude, elevation or distance are measured in meters! In most cases there will be helper functions for defining these values in feet (for length, altitude, elevation) or statute miles (for visibility).

Known issues

Status

GitHub Tag NPM Version GitHub License

Legal stuff

Author: Frank Boës

Copyright & license: See LICENSE.txt

This tool is NOT affiliated with, endorsed, or sponsored by IPACS GbR. As stated in the LICENSE.txt, this tool comes with no warranty and might damage your files.

This software complies with the General Data Protection Regulation (GDPR) as it does not collect nor transmits any personal data to third parties.