https://wiki.hoggitworld.com/index.php?title=MIST_units_in_zones&feed=atom&action=historyMIST units in zones - Revision history2024-03-28T20:18:08ZRevision history for this page on the wikiMediaWiki 1.30.0https://wiki.hoggitworld.com/index.php?title=MIST_units_in_zones&diff=1065&oldid=prevGrimes at 23:12, 13 April 20182018-04-13T23:12:36Z<p></p>
<p><b>New page</b></p><div>{{Mission Scripting<br />
<br />
|fName= mist.flagFunc.units_in_zones<br />
<br />
|vNum = Mist 1.0<br />
<br />
|desc= Sets a flag true when the a required number of units are inside of the specified zones.<br />
<br />
|rtnType= nothing<br />
<br />
|reqType1= table<br />
<br />
|reqName1= vars<br />
<br />
|reqType2= <br />
<br />
|reqName2= <br />
<br />
|reqType3= <br />
<br />
|reqName3= <br />
<br />
|reqType4= <br />
<br />
|reqName4= <br />
<br />
|reqType5= <br />
<br />
|reqName5= <br />
<br />
|optType1= <br />
<br />
|optName1= <br />
<br />
|optType2= <br />
<br />
|optName2= <br />
<br />
|optType3= <br />
<br />
|optName3= <br />
<br />
|optType4= <br />
<br />
|optName4= <br />
<br />
|optType5= <br />
<br />
|optName5= <br />
<br />
|varExamples= {{varsTable<br />
<br />
|r1T= UnitNameTable<br />
|r1N= units<br />
<br />
|r2T= table<br />
|r2N= zones<br />
<br />
|r3T= number/string<br />
|r3N= flag<br />
<br />
|r4T= <br />
|r4N= <br />
<br />
|r5T= <br />
|r5N= <br />
<br />
|r6T= <br />
|r6N= <br />
<br />
|o1T= number/string<br />
|o1N= stopFlag<br />
<br />
|o2T= string<br />
|o2N= zone_type<br />
<br />
|o3T= number<br />
|o3N= req_num<br />
<br />
|o4T= number<br />
|o4N= interval<br />
<br />
|o5T= boolean<br />
|o5N= toggle<br />
<br />
|o6T= table<br />
|o6N= unitTableDef<br />
<br />
|o7N=<br />
<br />
|r1D= is a UnitNameTable- a table of unit names that follow a special set of rules (see the entry <br />
on UnitNameTables).<br />
|r2D= is a table of zone names (indexed numerically)<br />
|r3D= is the flag number that will be set true if the conditions are met<br />
|r4D=<br />
|r5D=<br />
|r6D=<br />
<br />
|o1D= is an optional variable that allows you to specify a flag number that, if set true, will <br />
stop the process. <br />
|o2D= is an optional variable that allows you to specify the minimum number of units that <br />
must be in one (or more) of the zones before flag is set true. <ins> If req_num is not specified, it <br />
defaults to 1. </ins><br />
|o3D= is an optional variable that defines the shape of the zones. The following are the <br />
allowed values for zone_type: <br />
'cylinder' - cylindrical shaped zone extending to +/- infinity in altitude. <br />
'sphere' - spherical zone. <br />
<br />
If not specified, it defaults to 'cylinder'. <br />
|o4D= is an optional variable that allows you to specify how often (in seconds) the in-zone <br />
condition is checked; for lots of units in lots of zones (like hundreds of units in hundreds of <br />
different zones), it might be desirable to increase the interval to save computer processing <br />
time. <ins> If not specified, interval defaults to 1 </ins><br />
|o5D= is an optional variable that if present will switch the flag value to false when the <br />
required conditions are not met. If not specified toggle defaults to false. <br />
|o6D= is an optional table containing the a [[unitNameTables]] definition. If present this value will be used to modify the units checked if new units are dynamically added to the mission. This value and capability is also used if the units variable is given a unitNameTables definition. <br />
|o7D=<br />
<br />
}}<br />
<br />
|rtnExamples= nothing<br />
<br />
|example= <code><br />
do<br />
mist.flagFunc.units_in_zones{ <br />
units = {'Chevy11', 'Chevy12', 'Chevy13', 'Chevy14'}, <br />
zones = {'Mozdok', 'Krymsk', 'Anapa', 'Mineral'}, <br />
flag = 100, <br />
zone_type = 'sphere' <br />
}<br />
end<br />
</code><br />
<br />
|notes= Once this function is run, <ins>it will start a continuously evaluated process </ins>that will set flag flag true <br />
once units from units are inside any one of a series of zones listed in zones. This process will <br />
keep running, and flag will keep being set true as long as the unit(s)-in-zone(s) conditions <br />
persist, unless the process is stopped with stopflag. <br />
<br />
'''Mist 3.5''' allows for strings to be used to define flags. <br />
<br />
'''Mist 4.0''' has modified this function to better adapt to added any units dynamically spawned into the mission. If units or zone_units is passed as a unitNameTable definition table then that information will be added to the optional variables unitTableDef and zUnitTableDef. Once present there will be a check whenever dynamically added units are spawned into the mission, if those units fit into the unitNameTable definition then they will also be checked by the function.<br />
<br />
|funcs= {{listOfMistFlagFuncs}}<br />
<br />
}}<br />
[[Category: MIST|units_in_zones]]</div>Grimes