Difference between revisions of "Miz mission structure"

From DCS World Wiki - Hoggitworld.com
(Data and Samples)
 
Line 5: Line 5:
 
This page will not dive into excruciating detail of every possible key and value that may exist within a mission file. If you need details it is best to make a mission file on your own with whatever you are looking for, save, open the miz via favorite zip program, and then open the mission file in your favorite text editor to explore from there.  
 
This page will not dive into excruciating detail of every possible key and value that may exist within a mission file. If you need details it is best to make a mission file on your own with whatever you are looking for, save, open the miz via favorite zip program, and then open the mission file in your favorite text editor to explore from there.  
  
It is highly probable that inactive data is present within any given mission file. For example with the weather table information on static and dynamic weather may both be present if the mission was saved with either active in the past. Some value will decide which is currently active.  
+
There are a number of instances where "inactive data" may exist. For example with the weather table information on static and dynamic weather may both be present if the mission was saved with either active in the past. Some value will decide which is currently active.  
  
 
Many string values will either have "DictKey" or "ResKey" in the string names followed by numbers. Anything using these values falls under "localization" where the display name or files may be changed to support different speaking language users better.  
 
Many string values will either have "DictKey" or "ResKey" in the string names followed by numbers. Anything using these values falls under "localization" where the display name or files may be changed to support different speaking language users better.  
  
===Data and Samples===
+
==Data and Samples==
  
 
<pre>
 
<pre>
Line 40: Line 40:
 
     weather                : table  : Table with weather data
 
     weather                : table  : Table with weather data
 
</pre>
 
</pre>
 +
===Coalition===
 +
The coalition table will be the single largest table entry within the mission file due to it containing every single group and its tasking  within the mission. For further details on that see [[DCS_exam_group_plane]] for an aircraft group.
 +
<pre>
 +
["coalition"] =
 +
    {
 +
        ["blue"] =
 +
        {
 +
            ["bullseye"] =  --- vec2 coordinate of bullseye
 +
            {
 +
                ["y"] = 7997.1308571432,
 +
                ["x"] = 5961.7548571437,
 +
            }, -- end of ["bullseye"]
 +
            ["nav_points"] =
 +
            {
 +
                [1] =
 +
                {
 +
                    ["type"] = "Default",
 +
                    ["comment"] = "",
 +
                    ["callsignStr"] = "ADDER",
 +
                    ["id"] = 165,
 +
                    ["properties"] =
 +
                    {
 +
                        ["vnav"] = 1,
 +
                        ["scale"] = 0,
 +
                        ["vangle"] = 0,
 +
                        ["angle"] = 0,
 +
                        ["steer"] = 2,
 +
                    }, -- end of ["properties"]
 +
                    ["y"] = 565294.38378226,
 +
                    ["x"] = -258679.99585824,
 +
                    ["callsign"] = 8,
 +
                }, -- end of [1]
 +
                [2] =
 +
                {
 +
                    ["type"] = "Default",
 +
                    ["comment"] = "",
 +
                    ["callsignStr"] = "TankerWest",
 +
                    ["id"] = 166,
 +
                    ["properties"] =
 +
                    {
 +
                        ["vnav"] = 1,
 +
                        ["scale"] = 0,
 +
                        ["vangle"] = 0,
 +
                        ["angle"] = 0,
 +
                        ["steer"] = 0,
 +
                    }, -- end of ["properties"]
 +
                    ["y"] = 582950.21212368,
 +
                    ["x"] = -235302.37129506,
 +
                }, -- end of [2]
 +
            }, -- end of ["nav_points"]
 +
            }, -- end of ["nav_points"]
 +
            ["name"] = "blue",
 +
            ["country"] =
 +
            {
 +
                [1] =
 +
                {
 +
                    ["id"] = 46,        -- country id
 +
                    ["name"] = "Sweden",
 +
                    ["plane"] =
 +
                    {
 +
                        ["group"] =
 +
                        {}, -- list of groups
 +
                    },
 +
                    ["helicopter"] = {},
 +
                    ["ship"] = {},
 +
                    ["vehicle"] = {},
 +
                    ["static"] = {},
 +
                },
 +
            },
 +
        },
 +
    },
 +
},
 +
</pre>
 +
===Drawings===
 +
===Triggers===
 +
Trigger zones are indexed numerically.
 +
<pre>
 +
triggers = {
 +
      zones = {
 +
            [44] =
 +
            {
 +
                ["radius"] = 3000,
 +
                ["zoneId"] = 347,
 +
                ["color"] =
 +
                {
 +
                    [1] = 1,
 +
                    [2] = 1,
 +
                    [3] = 1,
 +
                    [4] = 0.15,
 +
                }, -- end of ["color"]
 +
                ["properties"] =
 +
                {
 +
                    [1] =
 +
                    {
 +
                        ["key"] = "lat",
 +
                        ["value"] = "B",
 +
                    }, -- end of [1]
 +
                    [2] =
 +
                    {
 +
                        ["key"] = "str",
 +
                        ["value"] = "East Esmaeil Abad",
 +
                    }, -- end of [2]
 +
                    [3] =
 +
                    {
 +
                        ["key"] = "type",
 +
                        ["value"] = "obj",
 +
                    }, -- end of [3]
 +
                }, -- end of ["properties"]
 +
                ["hidden"] = false,
 +
                ["y"] = -282851.07616364,
 +
                ["x"] = 381072.16872345,
 +
                ["name"] = "OBJB20",
 +
                ["type"] = 2,
 +
                ["verticies"] =
 +
                {
 +
                    [1] =
 +
                    {
 +
                        ["y"] = -298019.23760703,
 +
                        ["x"] = 376996.1784471,
 +
                    }, -- end of [1]
 +
                    [2] =
 +
                    {
 +
                        ["y"] = -276624.3163146,
 +
                        ["x"] = 367168.69201007,
 +
                    }, -- end of [2]
 +
                    [3] =
 +
                    {
 +
                        ["y"] = -269277.86743708,
 +
                        ["x"] = 384020.41465456,
 +
                    }, -- end of [3]
 +
                    [4] =
 +
                    {
 +
                        ["y"] = -287482.88329585,
 +
                        ["x"] = 396103.38978206,
 +
                    }, -- end of [4]
 +
                }, -- end of ["verticies"]
 +
            }, -- end of [44]
 +
    },
 +
},
 +
</pre>
 +
===Weather===
  
===Weather===
+
<pre>
 +
["weather"] =  
 +
    {
 +
        ["atmosphere_type"] = 0,
 +
        ["wind"] =  
 +
        {
 +
            ["at8000"] =  
 +
            {
 +
                ["speed"] = 19.5852,
 +
                ["dir"] = 42,
 +
            }, -- end of ["at8000"]
 +
            ["at2000"] =
 +
            {
 +
                ["speed"] = 7.2156,
 +
                ["dir"] = 130,
 +
            }, -- end of ["at2000"]
 +
            ["atGround"] =
 +
            {
 +
                ["speed"] = 3.0924,
 +
                ["dir"] = 129.99998663662,
 +
            }, -- end of ["atGround"]
 +
        }, -- end of ["wind"]
 +
        ["enable_fog"] = false,
 +
        ["qnh"] = 760,
 +
        ["visibility"] =
 +
        {
 +
            ["distance"] = 80000,
 +
        }, -- end of ["visibility"]
 +
        ["season"] =
 +
        {
 +
            ["temperature"] = 15,
 +
        }, -- end of ["season"]
 +
        ["type_weather"] = 0,
 +
        ["modifiedTime"] = true,
 +
        ["cyclones"] =
 +
        {
 +
            [1] =
 +
            {
 +
                ["pressure_spread"] = 859512.46434831,
 +
                ["centerZ"] = -17427.670420512,
 +
                ["ellipticity"] = 1.1876490209814,
 +
                ["rotation"] = 0.58150839105332,
 +
                ["pressure_excess"] = -1034,
 +
                ["centerX"] = 228564.94108067,
 +
            }, -- end of [1]
 +
        }, -- end of ["cyclones"]
 +
        ["name"] = "Winter, clean sky",
 +
        ["dust_density"] = 0,
 +
        ["groundTurbulence"] = 1.8288,
 +
        ["fog"] =
 +
        {
 +
            ["thickness"] = 0,
 +
            ["visibility"] = 25,
 +
        }, -- end of ["fog"]
 +
        ["enable_dust"] = false,
 +
        ["clouds"] =
 +
        {
 +
            ["thickness"] = 1570,
 +
            ["density"] = 7,
 +
            ["preset"] = "Preset7",
 +
            ["base"] = 4300,
 +
            ["iprecptns"] = 0,
 +
        }, -- end of ["clouds"]
 +
    }, -- end of ["weather"]
 +
</pre>

Latest revision as of 01:25, 16 November 2022

Intro

The mission file is a lua table present within a .miz file that is accessible to the scripting engine via the table env.mission. This table is almost the entirety of the contents of a given mission.

Notes

This page will not dive into excruciating detail of every possible key and value that may exist within a mission file. If you need details it is best to make a mission file on your own with whatever you are looking for, save, open the miz via favorite zip program, and then open the mission file in your favorite text editor to explore from there.

There are a number of instances where "inactive data" may exist. For example with the weather table information on static and dynamic weather may both be present if the mission was saved with either active in the past. Some value will decide which is currently active.

Many string values will either have "DictKey" or "ResKey" in the string names followed by numbers. Anything using these values falls under "localization" where the display name or files may be changed to support different speaking language users better.

Data and Samples

    coalition              : table  : Contains all coalition specific data including bullseye, nav_points, and all units. 
    coalitions             : table  : Contains a list of country ids that belong to a given coalition
    currentKey             : number : Value used by the editor to know what index the dictkey and reskeys are on. 
    date                   : table  : The date the mission takes place at with Year, Month, and Day entries
    descriptionText        : string : Mission briefing defined under the "Situation" page on the briefing panel
    descriptionBlueTask    : string : Blue coalition task defined on the briefing panel
    descriptionNeutralsTask: string : Neutral coalition task defined on the briefing panel
    descriptionRedTask     : string : Red coalition task defined on the briefing panel
    drawings               : table  : Table containing information on any drawing placed in the editor.
    failures               : table  : Only valid for single player missions. Lists failure parameters for whichever aircraft is set to player. If none are set to player it still populates. 
    forcedOptions          : table  : Options that are forced by the mission and their corresponding settings. 
    groundControl          : table  : Data on the number of Combined Arms slots and their respective coalitions is found here
    map                    : table  : Last position of the map view the user was looking at when the mission was saved. 
    maxDictId              : number : Internal value used to keep track of what the next unit and group id to use is. 
    pictureFileNameN       : table  : Neutral coalition briefing images
    pictureFileNameB       : table  : Blue coalition briefing images
    pictureFileNameR       : table  : Red coalition briefing images
    requiredModules        : table  : Table of mod names whose units are present within the mission. 
    result                 : table  : Conditions and actions defined by mission goals in the editor to decide if a mission is "won"
    start_time             : number : Time in seconds since midnight for the date set when the mission starts
    sortie                 : string : Name of the mission as defined in the briefing panel.
    theatre                : string : Name of the map the mission takes place on 
    triggers               : table  : Table of trigger zones indexed numerically 
    trig                   : table  : Table containing every single trigger.
    trigRules              : table  : Another table containing data on triggers
    version                : number : Value used by the mission editor to know roughly which iteration of the editor the mission was saved in. Used for compatibility warning messages if you open a newer mission in an older editor. 
    weather                : table  : Table with weather data

Coalition

The coalition table will be the single largest table entry within the mission file due to it containing every single group and its tasking within the mission. For further details on that see DCS_exam_group_plane for an aircraft group.

 ["coalition"] = 
    {
        ["blue"] = 
        {
            ["bullseye"] =  --- vec2 coordinate of bullseye
            {
                ["y"] = 7997.1308571432,
                ["x"] = 5961.7548571437,
            }, -- end of ["bullseye"]
            ["nav_points"] = 
            {
                [1] = 
                {
                    ["type"] = "Default",
                    ["comment"] = "",
                    ["callsignStr"] = "ADDER",
                    ["id"] = 165,
                    ["properties"] = 
                    {
                        ["vnav"] = 1,
                        ["scale"] = 0,
                        ["vangle"] = 0,
                        ["angle"] = 0,
                        ["steer"] = 2,
                    }, -- end of ["properties"]
                    ["y"] = 565294.38378226,
                    ["x"] = -258679.99585824,
                    ["callsign"] = 8,
                }, -- end of [1]
                [2] = 
                {
                    ["type"] = "Default",
                    ["comment"] = "",
                    ["callsignStr"] = "TankerWest",
                    ["id"] = 166,
                    ["properties"] = 
                    {
                        ["vnav"] = 1,
                        ["scale"] = 0,
                        ["vangle"] = 0,
                        ["angle"] = 0,
                        ["steer"] = 0,
                    }, -- end of ["properties"]
                    ["y"] = 582950.21212368,
                    ["x"] = -235302.37129506,
                }, -- end of [2]
            }, -- end of ["nav_points"]
            }, -- end of ["nav_points"]
            ["name"] = "blue",
            ["country"] = 
            {
                [1] = 
                {
                    ["id"] = 46,         -- country id
                    ["name"] = "Sweden",
                    ["plane"] = 
                    {
                        ["group"] = 
                        {}, -- list of groups
                    },
                    ["helicopter"] = {},
                    ["ship"] = {},
                    ["vehicle"] = {},
                    ["static"] = {},
                 }, 
             }, 
         }, 
    },
 },

Drawings

Triggers

Trigger zones are indexed numerically.

triggers = {
      zones = {
            [44] = 
            {
                ["radius"] = 3000,
                ["zoneId"] = 347,
                ["color"] = 
                {
                    [1] = 1,
                    [2] = 1,
                    [3] = 1,
                    [4] = 0.15,
                }, -- end of ["color"]
                ["properties"] = 
                {
                    [1] = 
                    {
                        ["key"] = "lat",
                        ["value"] = "B",
                    }, -- end of [1]
                    [2] = 
                    {
                        ["key"] = "str",
                        ["value"] = "East Esmaeil Abad",
                    }, -- end of [2]
                    [3] = 
                    {
                        ["key"] = "type",
                        ["value"] = "obj",
                    }, -- end of [3]
                }, -- end of ["properties"]
                ["hidden"] = false,
                ["y"] = -282851.07616364,
                ["x"] = 381072.16872345,
                ["name"] = "OBJB20",
                ["type"] = 2,
                ["verticies"] = 
                {
                    [1] = 
                    {
                        ["y"] = -298019.23760703,
                        ["x"] = 376996.1784471,
                    }, -- end of [1]
                    [2] = 
                    {
                        ["y"] = -276624.3163146,
                        ["x"] = 367168.69201007,
                    }, -- end of [2]
                    [3] = 
                    {
                        ["y"] = -269277.86743708,
                        ["x"] = 384020.41465456,
                    }, -- end of [3]
                    [4] = 
                    {
                        ["y"] = -287482.88329585,
                        ["x"] = 396103.38978206,
                    }, -- end of [4]
                }, -- end of ["verticies"]
            }, -- end of [44]
     },
},

Weather

["weather"] = 
    {
        ["atmosphere_type"] = 0,
        ["wind"] = 
        {
            ["at8000"] = 
            {
                ["speed"] = 19.5852,
                ["dir"] = 42,
            }, -- end of ["at8000"]
            ["at2000"] = 
            {
                ["speed"] = 7.2156,
                ["dir"] = 130,
            }, -- end of ["at2000"]
            ["atGround"] = 
            {
                ["speed"] = 3.0924,
                ["dir"] = 129.99998663662,
            }, -- end of ["atGround"]
        }, -- end of ["wind"]
        ["enable_fog"] = false,
        ["qnh"] = 760,
        ["visibility"] = 
        {
            ["distance"] = 80000,
        }, -- end of ["visibility"]
        ["season"] = 
        {
            ["temperature"] = 15,
        }, -- end of ["season"]
        ["type_weather"] = 0,
        ["modifiedTime"] = true,
        ["cyclones"] = 
        {
            [1] = 
            {
                ["pressure_spread"] = 859512.46434831,
                ["centerZ"] = -17427.670420512,
                ["ellipticity"] = 1.1876490209814,
                ["rotation"] = 0.58150839105332,
                ["pressure_excess"] = -1034,
                ["centerX"] = 228564.94108067,
            }, -- end of [1]
        }, -- end of ["cyclones"]
        ["name"] = "Winter, clean sky",
        ["dust_density"] = 0,
        ["groundTurbulence"] = 1.8288,
        ["fog"] = 
        {
            ["thickness"] = 0,
            ["visibility"] = 25,
        }, -- end of ["fog"]
        ["enable_dust"] = false,
        ["clouds"] = 
        {
            ["thickness"] = 1570,
            ["density"] = 7,
            ["preset"] = "Preset7",
            ["base"] = 4300,
            ["iprecptns"] = 0,
        }, -- end of ["clouds"]
    }, -- end of ["weather"]