MIST mapobjs dead polygon

From DCS World Wiki - Hoggitworld.com
Revision as of 23:22, 13 April 2018 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.flagFunc.mapobjs_dead_polygon

Added with: Mist 1.0
Description
Sets a flag true when the a required number of world objects are dead within the specified zones.
Syntax
nothing mist.flagFunc.mapobjs_dead_polygon(table vars )
Valid Input Values:

vars tables have the following recognized fields( required entries in blue, optional in green):

 vars = 
 {
 zone = table zone, 
 flag = number/string flag,
 stopFlag = number/string stopFlag, 
 req_num = number req_num,
 }

zone is a table of map points that defines the polygon shape (indexed numerically). See pointInPolygon for a good explanation.

flag is the flag number that will be set true if the conditions are met

stopFlag is an optional variable that allows you to specify a flag number that, if set true, will stop the process.

req_num is an optional variable that allows you to specify the minimum number of units that must be in one (or more) of the zones before flag is set true. If req_num is not specified, it defaults to 1.

Return value:
nothing
Return example:
nothing
Usage Examples:

do

 mist.flagFunc.mapobjs_dead_polygon{  
   zone = { 
       [1] = mist.DBs.unitsByName['NE corner'].point, 
       [2] = mist.DBs.unitsByName['SE corner'].point,  
       [3] = mist.DBs.unitsByName['SW corner'].point, 
       [4] = mist.DBs.unitsByName['NW corner'].point 
   }, 
   flag = 151, 
   req_num = 15, 
 } 

end

do

 mist.flagFunc.mapobjs_dead_polygon{  
   zone = mist.getGroupPoints('Russia group'),  
   flag = 90, 
   req_num = 50, 
 }

end

Notes:
Once this function is run, it will start a continuously evaluated process that will set flag flag true

if map objects (such as bridges, buildings in town, etc.) die (or have died) in a mission editor zone (or set of zones). This will only happen once; once the flag flag is set true, the process ends

Mist 3.5 allows for strings to be used to define flags.

Related Functions
mapobjs_dead_polygon, Mapobjs_dead_zones, units_in_zones, units_in_moving_zones, units_in_polygon, units_LOS, group_alive, group_dead, group_alive_more_than, group_alive_less_than

Scripting Engine

MIST Root Page