Difference between revisions of "MIST group alive less"

From DCS World Wiki - Hoggitworld.com
 
 
Line 62: Line 62:
 
|o1D=  is an optional variable that allows you to specify a flag number that, if set true, will  
 
|o1D=  is an optional variable that allows you to specify a flag number that, if set true, will  
 
stop the process.   
 
stop the process.   
|o2D= is an optional variable that allows you to specify how often (in seconds) the function is checked. If not specified, interval defaults to 1 </ins>
+
|o2D= is an optional variable that allows you to specify how often (in seconds) the function is checked. If not specified, interval defaults to 1
 
|o3D= is an optional variable that if present will switch the flag value to false when the  
 
|o3D= is an optional variable that if present will switch the flag value to false when the  
 
required conditions are not met.  If not specified toggle defaults to false.   
 
required conditions are not met.  If not specified toggle defaults to false.   
Line 72: Line 72:
 
|rtnExamples= nothing
 
|rtnExamples= nothing
  
|example= <code>
+
|example= The following will display a message when less than 20% of the group is alive.
 +
 
 
   mist.flagFunc.group_alive_less_than {
 
   mist.flagFunc.group_alive_less_than {
     units = 'myGroup,
+
     groupName = "myGroup",
 
     flag = 100,
 
     flag = 100,
 
     percent = 20,
 
     percent = 20,
Line 80: Line 81:
 
   }
 
   }
  
Mission Editor Trigger: Switched Condition> Flag 100 is True> Message To All('myGroup has less than 20 percent of its units remaining alive!')
+
Mission Editor Trigger:
 +
    Switched Condition> Flag 100 is True> Message To All('myGroup has less than 20 percent of its units remaining alive!')
  
  
</code>
 
  
 
|notes= The mission editor triggers does not "see" dynamically spawned groups, while the simulator scripting engine does. The purpose of this function is to create a mission editor like condition that works with dynamically spawned AI.  
 
|notes= The mission editor triggers does not "see" dynamically spawned groups, while the simulator scripting engine does. The purpose of this function is to create a mission editor like condition that works with dynamically spawned AI.  

Latest revision as of 05:54, 19 April 2021


mist.flagFunc.group_alive_less_than

Added with: Mist 3.5
Description
Sets a flag true if the specified group is alive less than the specified percentage.
Syntax
nothing mist.flagFunc.group_alive_less_than(table vars )
Valid Input Values:

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

 vars = 
 {
 groupName = string groupName, 
 flag = number/string flag, 
 percent = number percent,
 stopFlag = number/string stopFlag, 
 interval = number interval, 
 toggle = boolean toggle,
 }

groupName is the name of the group to check

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

percent is the percentage of the group that must be alive for the flag to be set true. Value is 'out of 100'. The number (50) represents 50%.

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

interval is an optional variable that allows you to specify how often (in seconds) the function is checked. If not specified, interval defaults to 1

toggle is an optional variable that if present will switch the flag value to false when the required conditions are not met. If not specified toggle defaults to false.

Return value:
nothing
Return example:
nothing
Usage Examples:
The following will display a message when less than 20% of the group is alive.
 mist.flagFunc.group_alive_less_than {
   groupName = "myGroup",
   flag = 100,
   percent = 20,
   toggle = true,
 }

Mission Editor Trigger:

   Switched Condition> Flag 100 is True> Message To All('myGroup has less than 20 percent of its units remaining alive!')
Notes:
The mission editor triggers does not "see" dynamically spawned groups, while the simulator scripting engine does. The purpose of this function is to create a mission editor like condition that works with dynamically spawned AI.
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