@fboes/aerofly-custom-missions 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +24 -15
- package/dist/index.js +9 -1
- package/package.json +1 -1
- package/src/index.ts +12 -3
- package/types/index.d.ts +7 -2
- package/types/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
> Builder for Aerofly FS4 Custom Missions Files
|
|
4
4
|
|
|
5
|
-
[Aerofly Flight Simulator 4](https://www.aerofly.com/) has a custom
|
|
5
|
+
[Aerofly Flight Simulator 4](https://www.aerofly.com/) 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.
|
|
6
6
|
|
|
7
7
|
This library is intended to work in modern browsers as well as [Node.js](https://nodejs.org/en).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
Either download the [`dist/index.js`](dist/index.js) to a sensible location in your web project, or do a NPM installation:
|
|
11
|
+
Either download the [`dist/index.js`](dist/index.js) to a sensible location in your web or Node.js project, or do a NPM installation:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install @fboes/aerofly-custom-missions --save
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Instead of a local installation 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.
|
|
17
|
+
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.
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
20
|
<script type="module" src="https://unpkg.com/@fboes/aerofly-custom-missions@latest/dist/index.js"></script>
|
|
@@ -50,15 +50,13 @@ You might want to enable TypeScript type checking by adding `// @ts-check` as yo
|
|
|
50
50
|
|
|
51
51
|
### Basic idea
|
|
52
52
|
|
|
53
|
-
All objects are basic structures needed for the
|
|
54
|
-
|
|
55
|
-
You can alter the properties of the objects afterwards, or (in some cases) by passing an optional configuration object to the constructor.
|
|
53
|
+
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.
|
|
56
54
|
|
|
57
55
|
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`.
|
|
58
56
|
|
|
59
57
|
### Building a missions file
|
|
60
58
|
|
|
61
|
-
A mission file contains multiple missions.
|
|
59
|
+
A mission file contains one or multiple missions. Building this file starts with the outer container, wich contains the missions:
|
|
62
60
|
|
|
63
61
|
```javascript
|
|
64
62
|
// Build a missions list
|
|
@@ -74,7 +72,7 @@ console.log(missionList.toString());
|
|
|
74
72
|
|
|
75
73
|
### Building a mission
|
|
76
74
|
|
|
77
|
-
A mission needs multiple properties:
|
|
75
|
+
A single mission needs multiple properties:
|
|
78
76
|
|
|
79
77
|
- The aircraft, its position and state
|
|
80
78
|
- The time and weather conditions
|
|
@@ -105,8 +103,8 @@ const checkpoints = [
|
|
|
105
103
|
const mission = new AeroflyMission("From Concord to Martha's Vineyard", {
|
|
106
104
|
aircraft: {
|
|
107
105
|
name: "c172",
|
|
108
|
-
livery: "",
|
|
109
106
|
icao: "C172",
|
|
107
|
+
livery: "",
|
|
110
108
|
},
|
|
111
109
|
checkpoints,
|
|
112
110
|
conditions,
|
|
@@ -119,26 +117,37 @@ const missionList = new AeroflyMissionsList([mission]);
|
|
|
119
117
|
console.log(missionList.toString());
|
|
120
118
|
```
|
|
121
119
|
|
|
122
|
-
As there are lots of properties for the
|
|
120
|
+
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.
|
|
123
121
|
|
|
124
122
|
### Important notices
|
|
125
123
|
|
|
126
124
|
- 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.
|
|
127
|
-
-
|
|
125
|
+
- Flight plans almost always require at least 4 checkpoints:
|
|
128
126
|
- `origin`
|
|
129
127
|
- `departure_runway`
|
|
130
128
|
- `destination_runway`
|
|
131
129
|
- `destination`
|
|
132
|
-
- Be aware that all
|
|
130
|
+
- 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).
|
|
131
|
+
|
|
132
|
+
### Known issues
|
|
133
|
+
|
|
134
|
+
- `AeroflyMissionConditions.time`: Even though a date property is available in Aerofly FS 4 (which is not accessible to the user), [the custom missions cannot change the date in Aerofly FS 4](https://www.aerofly.com/community/forum/index.php?thread/22487-more-settings-for-environment-conditions/&pageNo=1).
|
|
135
|
+
- `AeroflyMissionConditions.clouds`: Even though Aerofly FS 4 is able to handle three levels of clouds (two of which are accessible to the user), the custom missions can only set one level in Aerofly FS 4.
|
|
136
|
+
- `AeroflyMissionCheckpoint.type`: Even though internal flight plans of Aerofly FS 4 has types `"departure"|"arrival"|"approach"`, [Aerofly FS 4 dumps SIDs and STARs on loading a custom missions](https://www.aerofly.com/community/forum/index.php?thread/22156-flight-plans/).
|
|
137
|
+
- `AeroflyMission.aircraft.livery`: Even though Aerofly FS 4 knows multiple liveries per plane, [the custom missions file is not able to set liveries to any other but the standard livery](https://www.aerofly.com/community/forum/index.php?thread/19105-user-created-custom-missions/).
|
|
133
138
|
|
|
134
139
|
## Status
|
|
135
140
|
|
|
136
|
-
[](https://github.com/fboes/aerofly-custom-missions)
|
|
142
|
+
[](https://www.npmjs.com/package/@fboes/aerofly-custom-missions)
|
|
143
|
+

|
|
139
144
|
|
|
140
145
|
## Legal stuff
|
|
141
146
|
|
|
142
147
|
Author: [Frank Boës](https://3960.org)
|
|
143
148
|
|
|
144
149
|
Copyright & license: See [LICENSE.txt](LICENSE.txt)
|
|
150
|
+
|
|
151
|
+
This tool is NOT affiliated with, endorsed, or sponsored by IPACS GbR. As stated in the [LICENSE.txt](LICENSE.txt), this tool comes with no warranty and might damage your files.
|
|
152
|
+
|
|
153
|
+
This software complies with the General Data Protection Regulation (GDPR) as it does not collect nor transmits any personal data to third parties.
|
package/dist/index.js
CHANGED
|
@@ -50,8 +50,8 @@ export class AeroflyMission {
|
|
|
50
50
|
*/
|
|
51
51
|
constructor(title, { description = "", flightSetting = "taxi", aircraft = {
|
|
52
52
|
name: "c172",
|
|
53
|
-
livery: "",
|
|
54
53
|
icao: "",
|
|
54
|
+
livery: "",
|
|
55
55
|
}, callsign = "", origin = {
|
|
56
56
|
icao: "",
|
|
57
57
|
longitude: 0,
|
|
@@ -202,6 +202,14 @@ export class AeroflyMissionConditions {
|
|
|
202
202
|
get visibility_sm() {
|
|
203
203
|
return this.visibility / meterPerStatuteMile;
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Will set `this.thermalStrength`
|
|
207
|
+
* @param {number} temperature in °C
|
|
208
|
+
*/
|
|
209
|
+
set temperature(temperature) {
|
|
210
|
+
// Range from 5°C to 30°C
|
|
211
|
+
this.thermalStrength = Math.max(0, (temperature - 5) / 25);
|
|
212
|
+
}
|
|
205
213
|
/**
|
|
206
214
|
* @returns {string}
|
|
207
215
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -43,13 +43,13 @@ export type AeroflyMissionCheckpointType =
|
|
|
43
43
|
/**
|
|
44
44
|
* Data for the aircraft to use on this mission
|
|
45
45
|
* @property name lowercase Aerofly aircraft ID
|
|
46
|
-
* @property livery (not used yet)
|
|
47
46
|
* @property icao ICAO aircraft code
|
|
47
|
+
* @property livery (not used yet)
|
|
48
48
|
*/
|
|
49
49
|
export type AeroflyMissionAircraft = {
|
|
50
50
|
name: string;
|
|
51
|
-
livery: string;
|
|
52
51
|
icao: string;
|
|
52
|
+
livery: string;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -176,8 +176,8 @@ export class AeroflyMission {
|
|
|
176
176
|
flightSetting = "taxi",
|
|
177
177
|
aircraft = {
|
|
178
178
|
name: "c172",
|
|
179
|
-
livery: "",
|
|
180
179
|
icao: "",
|
|
180
|
+
livery: "",
|
|
181
181
|
},
|
|
182
182
|
callsign = "",
|
|
183
183
|
origin = {
|
|
@@ -402,6 +402,15 @@ export class AeroflyMissionConditions {
|
|
|
402
402
|
return this.visibility / meterPerStatuteMile;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
+
/**
|
|
406
|
+
* Will set `this.thermalStrength`
|
|
407
|
+
* @param {number} temperature in °C
|
|
408
|
+
*/
|
|
409
|
+
set temperature(temperature: number) {
|
|
410
|
+
// Range from 5°C to 30°C
|
|
411
|
+
this.thermalStrength = Math.max(0, (temperature - 5) / 25);
|
|
412
|
+
}
|
|
413
|
+
|
|
405
414
|
/**
|
|
406
415
|
* @returns {string}
|
|
407
416
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -37,13 +37,13 @@ export type AeroflyMissionCheckpointType =
|
|
|
37
37
|
/**
|
|
38
38
|
* Data for the aircraft to use on this mission
|
|
39
39
|
* @property name lowercase Aerofly aircraft ID
|
|
40
|
-
* @property livery (not used yet)
|
|
41
40
|
* @property icao ICAO aircraft code
|
|
41
|
+
* @property livery (not used yet)
|
|
42
42
|
*/
|
|
43
43
|
export type AeroflyMissionAircraft = {
|
|
44
44
|
name: string;
|
|
45
|
-
livery: string;
|
|
46
45
|
icao: string;
|
|
46
|
+
livery: string;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Weather data for wind
|
|
@@ -253,6 +253,11 @@ export declare class AeroflyMissionConditions {
|
|
|
253
253
|
* @returns {number} `this.visibility` in statute miles instead of meters
|
|
254
254
|
*/
|
|
255
255
|
get visibility_sm(): number;
|
|
256
|
+
/**
|
|
257
|
+
* Will set `this.thermalStrength`
|
|
258
|
+
* @param {number} temperature in °C
|
|
259
|
+
*/
|
|
260
|
+
set temperature(temperature: number);
|
|
256
261
|
/**
|
|
257
262
|
* @returns {string}
|
|
258
263
|
*/
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAClC,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,aAAa,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAClC,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,aAAa,CA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