Difference between revisions of "MIST writeGroup"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.debug.writeGroup| |vNum = Mist 4.5 |desc= Writes the table from the miz file corresponding to the passed group to a file of the same name....")
 
 
(One intermediate revision by the same user not shown)
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]]
 
|
 
|
  
 
|rtnType= nothing
 
|rtnType= nothing
  
|reqType1=  
+
|reqType1= string
  
|reqName1=  
+
|reqName1= groupName
  
 
|reqType2=  
 
|reqType2=  
 
|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