Difference between revisions of "MIST writeGroup"

From DCS World Wiki - Hoggitworld.com
 
Line 6: Line 6:
  
 
|desc= Writes the table from the miz file corresponding to the passed group to a file of the same name. This is useful for quickly getting the contents of any tasks or custom data for reference or later scripting use. For example writing the table for an aircraft and copying the contents of the payload entry within that table into your own script.  
 
|desc= Writes the table from the miz file corresponding to the passed group to a file of the same name. This is useful for quickly getting the contents of any tasks or custom data for reference or later scripting use. For example writing the table for an aircraft and copying the contents of the payload entry within that table into your own script.  
 +
 +
Optional value data if present will write what is returned via [[MIST getGroupData|mist.getGroupData]] for that group. Otherwise the function uses [[MIST getGroupTable|mist.getGrouoTable]]
 
|
 
|
  
Line 17: Line 19:
 
|reqType4=  
 
|reqType4=  
  
|optType1=  
+
|optType1= boolean
|optName1=  
+
|optName1= data
  
 
|optType2=
 
|optType2=

Latest revision as of 22:50, 7 July 2021


mist.debug.writeGroup

Added with: Mist 4.5
Description
Writes the table from the miz file corresponding to the passed group to a file of the same name. This is useful for quickly getting the contents of any tasks or custom data for reference or later scripting use. For example writing the table for an aircraft and copying the contents of the payload entry within that table into your own script.

Optional value data if present will write what is returned via mist.getGroupData for that group. Otherwise the function uses mist.getGrouoTable

Syntax
nothing mist.debug.writeGroup(string groupName , boolean data )
Valid Input Values:
fileName:
Return value:
nothing
Return example:
Examples here:
   Ground Group
   Ship Group  
   Helicopter Group
   Plane Group
Usage Examples:
The following would output every single group in your mission to their own file.
 for gName, gData in pairs(mist.DBs.groupsByName) do
       mist.debug.writeGroup(gName)	
 end
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

Scripting Engine

MIST Root Page