MIST writeTypes: Difference between revisions
From DCS World Wiki - Hoggitworld.com
Created page with "{{Mission Scripting |fName= mist.debug.writeTypes| |vNum = Mist 4.5 |desc= Writes a table of data from your mission file. Contains entries for unit type names, countries, l..." |
No edit summary |
||
| Line 5: | Line 5: | ||
|vNum = Mist 4.5 | |vNum = Mist 4.5 | ||
|desc= Writes a table of data from your mission file. Contains entries for unit type names, countries, livery names, and CLSIDs. | |desc= Writes a table of data from your mission file. Contains entries for unit type names, countries, livery names, and CLSIDs. The table that is written is returned in the function. | ||
| | | | ||
|rtnType= | |rtnType= table | ||
|reqType1= string | |reqType1= string | ||
| Line 27: | Line 27: | ||
fileName: | fileName: | ||
|rtnExamples= | |rtnExamples= The following is a rough outline of the table format: | ||
{ | |||
countries = { | |||
[countryName] = { | |||
[categoryName] = { | |||
[unitTypeName] = number of that type for that country, | |||
}, | |||
}, | |||
}, | |||
units = { | |||
[unitTypeName] = { | |||
count = total number of this type in the mission, | |||
pylons = { | |||
[pylonIndex] = { | |||
[CLSID value] = number of times it is used on that pylon | |||
}, | |||
}, | |||
CLSID = { | |||
[CLSID value] = number of times it is used on that aircraft, | |||
}, | |||
livery_id = { | |||
[countryName] = | |||
[liveryName] = number of times livery is used for that country, | |||
}, | |||
}, | |||
}, | |||
}, | |||
} | |||
|example= The following would output the data to the pass filename. | |example= The following would output the data to the pass filename. | ||
Latest revision as of 07:19, 23 August 2021
mist.debug.writeTypes
| Added with: Mist 4.5 |
| Description |
| Writes a table of data from your mission file. Contains entries for unit type names, countries, livery names, and CLSIDs. The table that is written is returned in the function. |
| Syntax |
| table mist.debug.writeTypes(string fileName ) |
| Valid Input Values: |
| fileName: |
| Return value: |
| table |
| Return example: |
The following is a rough outline of the table format:
{
countries = {
[countryName] = {
[categoryName] = {
[unitTypeName] = number of that type for that country,
},
},
},
units = {
[unitTypeName] = {
count = total number of this type in the mission,
pylons = {
[pylonIndex] = {
[CLSID value] = number of times it is used on that pylon
},
},
CLSID = {
[CLSID value] = number of times it is used on that aircraft,
},
livery_id = {
[countryName] =
[liveryName] = number of times livery is used for that country,
},
},
},
},
}
|
| Usage Examples: |
The following would output the data to the pass filename.
mist.debug.writeTypes('myMission.lua')
|
| Notes: |
| For this debug function you must (temporarily!) unprotect the Lua environment and enable the io and lfs libraries. You do this by commenting out the sanitizeModule calls in <DCS main directory>/Scripts/MissionScripting.lua. Just be sure to re-protect yourself later when you run missions from untrusted sources. |
| Related Functions |
| writeData, dumpDBs, dump_G, writeGroup, writeTypes, changeSetting |
