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

dcs-mission-maker

v1.9.1

Published

Javascript Library for Producing DCS Mission Files (.miz)

Downloads

16

Readme

DCS World Mission File Creator

This project provides a JavaScript class that can be used to manage the creation of DCS World mission files.

The primary use case is validation, this project holds lots of zod schemas for the mission file ensuring generated mission files conform to the DCS models.

It also exposes cherry-picked information from the mission editor database accessible in the ME_DB constant.

Installation

To install this package, you can use npm:

npm install dcs-mission-creator

Usage

To use this class, you can include it in your project and create a new instance of the DcsMission class:

const fs = require("fs");
const { DcsMission } = require("dcs-mission-creator");

const dcsMission = new DcsMission({ theatre: "Caucasus" });

dcsMission
  .build()
  .then((file) => fs.writeFileSync("example.miz", Buffer.from(file)));

In this example, we create a new instance of the DcsMission class with the theatre option set to "Caucasus". We then call the build method to generate the mission file content and write it to a file called "example.miz".

You can customize the mission by passing additional options to the DcsMission constructor, such as name, description, weather, time, map, airports, units, and more.

For more information on the available options and methods, please see the documentation provided with the class.

Data

The Library also exposes type hinted data from DCS in the form of direct json objects.

This information is exported via scripts present in the data/... folder and compiled into typescript for type information.

Add new scripts and JSON files then expose them in the .datarc.yml file

To get terrain data please use the global-terrain-database:

https://github.com/JonathanTurnock/dcs-global-terrain-database

It's an external library as it's not always required

Exploring

An me_db.bundle.json exists so you can browse its data using https://jsonhero.io/

Head to

https://jsonhero.io/

Paste the following link to explore the bundle

https://raw.githubusercontent.com/JonathanTurnock/dcs-mission-maker/master/data/me_db.bundle.json

Planes

Includes the Plane and some high level information

import { ME_DB } from "dcs-mission-maker"

ME_DB.planes["F-16C bl.50"] 
// {
//     type: "F-16C bl.50",
//     country_of_origin: "USA",
//     id: "F-16C bl.50",
//     tasks: [
//     "CAP",
//     "Escort",
//     "Fighter Sweep",
//     "Intercept",
//     "Pinpoint Strike",
//     "CAS",
//     "Ground Attack",
//     "Runway Attack",
//     "AFAC",
//     "Reconnaissance",
//     "Anti-ship Strike",
// ],
//     attribute: [
//     1,
//     1,
//     1,
//     7,
//     "Multirole fighters",
//     "Refuelable",
//     "Datalink",
//     "Link16",
//     "All",
//     "NonAndLightArmoredUnits",
//     "NonArmoredUnits",
//     "Air",
//     "Planes",
//     "Battle airplanes",
// ],
//     displayName: "F-16C bl.50",
// }

Helos

Includes the Helo and some high level information

import { ME_DB } from "dcs-mission-maker"

ME_DB.helos["Mi-24V"]
// {
//     type: "Mi-24V",
//     country_of_origin: "RUS",
//     id: "Mi-24V",
//     tasks: [
//     "CAS",
//     "Ground Attack",
//     "Escort",
//     "Transport",
//     "AFAC",
//     "Anti-ship Strike",
// ],
//     attribute: [
//     1,
//     2,
//     6,
//     152,
//     "Attack helicopters",
//     "All",
//     "NonAndLightArmoredUnits",
//     "NonArmoredUnits",
//     "Air",
//     "Helicopters",
// ],
//     displayName: "Mi-24V",
// }

Callnames

Includes the type it applies to and the id

import { ME_DB } from "dcs-mission-maker"

ME_DB.callnames.Venom
// {
//     id: 9,
//     types: ["F-16C bl.50", "F-16C_50", "F-16C bl.52d"],
//     callname: "Viper",
// }

Contributing

If you'd like to contribute to this project, please feel free to fork the repository and submit a pull request.

Expanding Schemas

To make a new Zod Schema first create the construct in the ME, (Place units, add waypoints etc)

Unzip the Mission File and copy the lua table to DCS Fiddle.

https://dcsfiddle.pages.dev/

Immediately return the table inline which will convert it to JSON for you, then use the following website to convert the JSON to a zod schema.

https://transform.tools/json-to-zod

License

This project is licensed under the MIT License. See the LICENSE file for more information.