Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist
2022-10-31 08:04:57 +01:00
67 changed files with 924 additions and 895 deletions
+166
View File
@@ -0,0 +1,166 @@
# Repository: https://github.com/CppCXY/EmmyLuaCodeStyle
# English documentation: https://github.com/CppCXY/EmmyLuaCodeStyle/blob/master/README_EN.md
[*.lua]
# [basic]
# optional space/tab
indent_style = space
# if indent_style is space, this is valid
indent_size = 4
# if indent_style is tab, this is valid
tab_width = 4
# none/single/double
quote_style = none
# only support number
continuation_indent_size = 0
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
end_of_line = auto
detect_end_of_line = false
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
# this option decides when to chopdown the code
max_line_length = 9999
# this will check text end with new line
insert_final_newline = true
# [function]
# function call expression's args will align to first arg
# optional true/false/only_after_more_indention_statement/only_not_exist_cross_row_expression
align_call_args = false
# if true, all function define params will align to first param
align_function_define_params = true
remove_expression_list_finish_comma = true
# keep/remove/remove_table_only/remove_string_only/unambiguous_remove_string_only
call_arg_parentheses = keep
# [table]
#optional none/comma/semicolon
table_separator_style = none
#optional keep/never/always/smart
trailing_table_separator = keep
# see document for detail
continuous_assign_table_field_align_to_equal_sign = true
# if true, format like this "local t = { 1, 2, 3 }"
keep_one_space_between_table_and_bracket = true
# if indent_style is tab, this option is invalid
align_table_field_to_first_field = true
# [statement]
align_chained_expression_statement = false
# continous line distance
max_continuous_line_distance = 1
# see document for detail
continuous_assign_statement_align_to_equal_sign = true
# if statement will align like switch case
if_condition_align_with_each_other = false
# if true, continuation_indent_size for local or assign statement is invalid
# however, if the expression list has cross row expression, it will not be aligned to the first expression
local_assign_continuation_align_to_first_expression = false
statement_inline_comment_space = 1
# [indentation]
# if true, the label loses its current indentation
label_no_indent = false
# if true, there will be no indentation in the do statement
do_statement_no_indent = false
# if true, the conditional expression of the if statement will not be a continuation line indent
if_condition_no_continuation_indent = false
if_branch_comments_after_block_no_indent = false
# [space]
# if true, t[#t+1] will not space wrapper '+'
table_append_expression_no_space = false
long_chain_expression_allow_one_space_after_colon = false
remove_empty_header_and_footer_lines_in_function = true
space_before_function_open_parenthesis = false
space_inside_function_call_parentheses = false
space_inside_function_param_list_parentheses = false
space_before_open_square_bracket = false
space_inside_square_brackets = false
# if true, ormat like this "local t <const> = 1"
keep_one_space_between_namedef_and_attribute = true
# [row_layout]
# The following configuration supports four expressions
# minLine:${n}
# keepLine
# keepLine:${n}
# maxLine:${n}
keep_line_after_if_statement = minLine:0
keep_line_after_do_statement = minLine:0
keep_line_after_while_statement = minLine:0
keep_line_after_repeat_statement = minLine:0
keep_line_after_for_statement = minLine:0
keep_line_after_local_or_assign_statement = keepLine
keep_line_after_function_define_statement = keepLine:1
keep_line_after_expression_statement = keepLine
# [diagnostic]
# the following is code diagnostic options
enable_check_codestyle = true
# [diagnostic.name_style]
enable_name_style_check = false
# the following is name style check rule
# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
# all option can use '|' represent or
# for example:
# snake_case | upper_snake_case
# same(first_param, snake_case)
# same('m')
local_name_define_style = snake_case
function_param_name_style = snake_case
function_name_define_style = snake_case
local_function_name_define_style = snake_case
table_field_name_define_style = snake_case
global_variable_name_define_style = snake_case|upper_snake_case
module_name_define_style = same('m')|same(filename, snake_case)
require_module_name_style = same(first_param, snake_case)
class_name_define_style = same(filename, snake_case)
-33
View File
@@ -1,33 +0,0 @@
# See https://github.com/Koihik/LuaFormatter
# Use '-- LuaFormatter off' and '-- LuaFormatter on' around code blocks to inhibit formatting
column_limit: 500
indent_width: 2
use_tab: false
continuation_indent_width: 2
keep_simple_control_block_one_line: false
keep_simple_function_one_line: false
align_args: true
break_after_functioncall_lp: false
break_before_functioncall_rp: false
align_parameter: true
chop_down_parameter: true
break_after_functiondef_lp: false
break_before_functiondef_rp: false
align_table_field: true
break_after_table_lb: true
break_before_table_rb: true
chop_down_table: true
chop_down_kv_table: true
column_table_limit: 500
table_sep: ','
extra_sep_at_table_end: true
break_after_operator: true
single_quote_to_double_quote: false
double_quote_to_single_quote: false
spaces_before_call: 1
spaces_inside_functiondef_parens: true
spaces_inside_functioncall_parens: true
spaces_inside_table_braces: true
spaces_around_equals_in_field: true
line_breaks_after_function_body: 1
+4 -4
View File
@@ -15,7 +15,7 @@
-- @extends AI.AI_Air_Patrol#AI_AIR_PATROL -- @extends AI.AI_Air_Patrol#AI_AIR_PATROL
-- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE -- @extends AI.AI_Air_Engage#AI_AIR_ENGAGE
--- The AI_A2A_CAP class implements the core functions to patrol a @{Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group} --- The AI_A2A_CAP class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone. -- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
-- --
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG) -- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
@@ -88,7 +88,7 @@
-- --
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG) -- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{#AI_A2A_CAP.SetEngageZone}() to define that Zone. -- Use the method @{#AI_A2A_CAP.SetEngageZone}() to define that Zone.
-- --
@@ -107,7 +107,7 @@ AI_A2A_CAP = {
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO". -- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
-- @param DCS#Speed PatrolMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
@@ -133,7 +133,7 @@ end
--- Creates a new AI_A2A_CAP object --- Creates a new AI_A2A_CAP object
-- @param #AI_A2A_CAP self -- @param #AI_A2A_CAP self
-- @param Wrapper.Group#GROUP AICap -- @param Wrapper.Group#GROUP AICap
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -57,8 +57,8 @@
-- --
-- ## 2. Which type of EWR will I setup? Grouping based per AREA, per TYPE or per UNIT? (Later others will follow). -- ## 2. Which type of EWR will I setup? Grouping based per AREA, per TYPE or per UNIT? (Later others will follow).
-- --
-- The MOOSE framework leverages the @{Detection} classes to perform the EWR detection. -- The MOOSE framework leverages the @{Functional.Detection} classes to perform the EWR detection.
-- Several types of @{Detection} classes exist, and the most common characteristics of these classes is that they: -- Several types of @{Functional.Detection} classes exist, and the most common characteristics of these classes is that they:
-- --
-- * Perform detections from multiple FACs as one co-operating entity. -- * Perform detections from multiple FACs as one co-operating entity.
-- * Communicate with a Head Quarters, which consolidates each detection. -- * Communicate with a Head Quarters, which consolidates each detection.
@@ -126,7 +126,7 @@
-- * polygon zones -- * polygon zones
-- * moving zones -- * moving zones
-- --
-- Depending on the type of zone selected, a different @{Zone} object needs to be created from a ZONE_ class. -- Depending on the type of zone selected, a different @{Core.Zone} object needs to be created from a ZONE_ class.
-- --
-- ## 14. For each Squadron doing CAP, what are the time intervals and CAP amounts to be performed? -- ## 14. For each Squadron doing CAP, what are the time intervals and CAP amounts to be performed?
-- --
@@ -356,7 +356,7 @@ do -- AI_A2A_DISPATCHER
-- --
-- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia9.JPG) -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia9.JPG)
-- --
-- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{zone} object derived from @{Core.Zone#ZONE_BASE}. -- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE}.
-- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than -- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than
-- it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. -- it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are.
-- In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. -- In a hot war the borders are effectively defined by the ground based radar coverage of a coalition.
@@ -592,7 +592,7 @@ do -- AI_A2A_DISPATCHER
-- A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) -- A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" )
-- A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) -- A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )
-- --
-- Note the different @{Zone} MOOSE classes being used to create zones of different types. Please click the @{Zone} link for more information about the different zone types. -- Note the different @{Core.Zone} MOOSE classes being used to create zones of different types. Please click the @{Core.Zone} link for more information about the different zone types.
-- Zones can be circles, can be setup in the mission editor using trigger zones, but can also be setup in the mission editor as polygons and in this case GROUP objects are being used! -- Zones can be circles, can be setup in the mission editor using trigger zones, but can also be setup in the mission editor as polygons and in this case GROUP objects are being used!
-- --
-- ## 7.2. Set the squadron to execute CAP: -- ## 7.2. Set the squadron to execute CAP:
@@ -1304,7 +1304,7 @@ do -- AI_A2A_DISPATCHER
--- Define a border area to simulate a **cold war** scenario. --- Define a border area to simulate a **cold war** scenario.
-- A **cold war** is one where CAP aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border. -- A **cold war** is one where CAP aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border.
-- A **hot war** is one where CAP aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send CAP and GCI aircraft to attack it. -- A **hot war** is one where CAP aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send CAP and GCI aircraft to attack it.
-- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this. -- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this.
-- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1 -- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1
-- @param #AI_A2A_DISPATCHER self -- @param #AI_A2A_DISPATCHER self
-- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE. -- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE.
@@ -1713,7 +1713,7 @@ do -- AI_A2A_DISPATCHER
-- Get free parking for fighter aircraft. -- Get free parking for fighter aircraft.
local nfreeparking = DefenderSquadron.Airbase:GetFreeParkingSpotsNumber( AIRBASE.TerminalType.FighterAircraft, true ) local nfreeparking = DefenderSquadron.Airbase:GetFreeParkingSpotsNumber( AIRBASE.TerminalType.FighterAircraft, true )
-- Take number of free parking spots if no resource count was specifed. -- Take number of free parking spots if no resource count was specified.
DefenderSquadron.ResourceCount = DefenderSquadron.ResourceCount or nfreeparking DefenderSquadron.ResourceCount = DefenderSquadron.ResourceCount or nfreeparking
-- Check that resource count is not larger than free parking spots. -- Check that resource count is not larger than free parking spots.
@@ -1758,7 +1758,7 @@ do -- AI_A2A_DISPATCHER
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param #number EngageAltType The altitude type to engage, which is a string "BARO" defining Barometric or "RADIO" defining radio controlled altitude. -- @param #number EngageAltType The altitude type to engage, which is a string "BARO" defining Barometric or "RADIO" defining radio controlled altitude.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the CAP will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the CAP will be executed.
-- @param #number PatrolMinSpeed The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed The minimum speed at which the cap can be executed.
-- @param #number PatrolMaxSpeed The maximum speed at which the cap can be executed. -- @param #number PatrolMaxSpeed The maximum speed at which the cap can be executed.
-- @param #number PatrolFloorAltitude The minimum altitude at which the cap can be executed. -- @param #number PatrolFloorAltitude The minimum altitude at which the cap can be executed.
@@ -1825,7 +1825,7 @@ do -- AI_A2A_DISPATCHER
--- Set a CAP for a Squadron. --- Set a CAP for a Squadron.
-- @param #AI_A2A_DISPATCHER self -- @param #AI_A2A_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the CAP will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the CAP will be executed.
-- @param #number PatrolFloorAltitude The minimum altitude at which the cap can be executed. -- @param #number PatrolFloorAltitude The minimum altitude at which the cap can be executed.
-- @param #number PatrolCeilingAltitude the maximum altitude at which the cap can be executed. -- @param #number PatrolCeilingAltitude the maximum altitude at which the cap can be executed.
-- @param #number PatrolMinSpeed The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed The minimum speed at which the cap can be executed.
+1 -1
View File
@@ -89,7 +89,7 @@
-- --
-- ![Zone](..\Presentations\AI_GCI\Dia12.JPG) -- ![Zone](..\Presentations\AI_GCI\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageZone}() to define that Zone. -- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageZone}() to define that Zone.
-- --
+6 -6
View File
@@ -13,7 +13,7 @@
--- @type AI_A2A_PATROL --- @type AI_A2A_PATROL
-- @extends AI.AI_A2A#AI_A2A -- @extends AI.AI_A2A#AI_A2A
--- Implements the core functions to patrol a @{Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}. --- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}.
-- --
-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG) -- ![Process](..\Presentations\AI_PATROL\Dia3.JPG)
-- --
@@ -102,7 +102,7 @@
-- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base. -- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated. -- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated.
-- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, -- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit,
-- while a new AI is targetted to the AI_A2A_PATROL. -- while a new AI is targeted to the AI_A2A_PATROL.
-- Once the time is finished, the old AI will return to the base. -- Once the time is finished, the old AI will return to the base.
-- Use the method @{#AI_A2A_PATROL.ManageFuel}() to have this proces in place. -- Use the method @{#AI_A2A_PATROL.ManageFuel}() to have this proces in place.
-- --
@@ -122,7 +122,7 @@ AI_A2A_PATROL = {
--- Creates a new AI_A2A_PATROL object --- Creates a new AI_A2A_PATROL object
-- @param #AI_A2A_PATROL self -- @param #AI_A2A_PATROL self
-- @param Wrapper.Group#GROUP AIPatrol The patrol group object. -- @param Wrapper.Group#GROUP AIPatrol The patrol group object.
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -264,7 +264,7 @@ function AI_A2A_PATROL:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
end end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{AI.AI_Patrol#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_A2A_PATROL self -- @param #AI_A2A_PATROL self
-- @return #AI_A2A_PATROL self -- @return #AI_A2A_PATROL self
-- @param Wrapper.Group#GROUP AIPatrol The Group Object managed by the FSM. -- @param Wrapper.Group#GROUP AIPatrol The Group Object managed by the FSM.
@@ -287,7 +287,7 @@ function AI_A2A_PATROL:onafterPatrol( AIPatrol, From, Event, To )
end end
--- This statis method is called from the route path within the last task at the last waaypoint of the AIPatrol. --- This static method is called from the route path within the last task at the last waypoint of the AIPatrol.
-- Note that this method is required, as triggers the next route when patrolling for the AIPatrol. -- Note that this method is required, as triggers the next route when patrolling for the AIPatrol.
-- @param Wrapper.Group#GROUP AIPatrol The AI group. -- @param Wrapper.Group#GROUP AIPatrol The AI group.
-- @param #AI_A2A_PATROL Fsm The FSM. -- @param #AI_A2A_PATROL Fsm The FSM.
@@ -302,7 +302,7 @@ function AI_A2A_PATROL.PatrolRoute( AIPatrol, Fsm )
end end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{AI.AI_Patrol#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_A2A_PATROL self -- @param #AI_A2A_PATROL self
-- @param Wrapper.Group#GROUP AIPatrol The Group managed by the FSM. -- @param Wrapper.Group#GROUP AIPatrol The Group managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
+2 -2
View File
@@ -31,7 +31,7 @@ AI_A2G_BAI = {
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO". -- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -55,7 +55,7 @@ end
-- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target. -- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target.
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
+2 -2
View File
@@ -31,7 +31,7 @@ AI_A2G_CAS = {
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO". -- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -55,7 +55,7 @@ end
-- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target. -- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target.
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -175,7 +175,7 @@
-- * polygon zones -- * polygon zones
-- * moving zones -- * moving zones
-- --
-- Depending on the type of zone selected, a different @{Zone} object needs to be created from a ZONE_ class. -- Depending on the type of zone selected, a different @{Core.Zone} object needs to be created from a ZONE_ class.
-- --
-- --
-- ## 12. Are moving defense coordinates possible? -- ## 12. Are moving defense coordinates possible?
@@ -1389,7 +1389,7 @@ do -- AI_A2G_DISPATCHER
--- Define a border area to simulate a **cold war** scenario. --- Define a border area to simulate a **cold war** scenario.
-- A **cold war** is one where Patrol aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border. -- A **cold war** is one where Patrol aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border.
-- A **hot war** is one where Patrol aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send Patrol and GCI aircraft to attack it. -- A **hot war** is one where Patrol aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send Patrol and GCI aircraft to attack it.
-- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this. -- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this.
-- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1 -- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE. -- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE.
@@ -2185,7 +2185,7 @@ do -- AI_A2G_DISPATCHER
-- The Sead patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Sead patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
-- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed. -- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed.
-- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
@@ -2234,7 +2234,7 @@ do -- AI_A2G_DISPATCHER
-- The Sead patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Sead patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
-- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed. -- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
@@ -2336,7 +2336,7 @@ do -- AI_A2G_DISPATCHER
-- The Cas patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Cas patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
-- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed. -- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed.
-- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
@@ -2385,7 +2385,7 @@ do -- AI_A2G_DISPATCHER
-- The Cas patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Cas patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
-- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed. -- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
@@ -2487,7 +2487,7 @@ do -- AI_A2G_DISPATCHER
-- The Bai patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Bai patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
-- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed. -- @param #number PatrolMaxSpeed (optional, default = 75% of max speed) The maximum speed at which the cap can be executed.
-- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number PatrolFloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
@@ -2536,7 +2536,7 @@ do -- AI_A2G_DISPATCHER
-- The Bai patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded. -- The Bai patrol will start a patrol of the aircraft at a specified zone, and will engage when commanded.
-- @param #AI_A2G_DISPATCHER self -- @param #AI_A2G_DISPATCHER self
-- @param #string SquadronName The squadron name. -- @param #string SquadronName The squadron name.
-- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed. -- @param Core.Zone#ZONE_BASE Zone The @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE} that defines the zone wherein the Patrol will be executed.
-- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed. -- @param #number FloorAltitude (optional, default = 1000m ) The minimum altitude at which the cap can be executed.
-- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed. -- @param #number CeilingAltitude (optional, default = 1500m ) The maximum altitude at which the cap can be executed.
-- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed. -- @param #number PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed at which the cap can be executed.
+3 -3
View File
@@ -65,7 +65,7 @@
-- --
-- ![Zone](..\Presentations\AI_GCI\Dia12.JPG) -- ![Zone](..\Presentations\AI_GCI\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageZone}() to define that Zone. -- TODO: Documentation. Check that this is actually correct. The originally referenced class does not exist. -- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageZone}() to define that Zone. -- TODO: Documentation. Check that this is actually correct. The originally referenced class does not exist.
-- --
@@ -84,7 +84,7 @@ AI_A2G_SEAD = {
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO". -- @param DCS#AltitudeType EngageAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
@@ -109,7 +109,7 @@ end
-- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target. -- @param DCS#Speed EngageMaxSpeed The maximum speed of the @{Wrapper.Group} in km/h when engaging a target.
-- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageFloorAltitude The lowest altitude in meters where to execute the engagement.
-- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement. -- @param DCS#Altitude EngageCeilingAltitude The highest altitude in meters where to execute the engagement.
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Group} in km/h.
+32 -33
View File
@@ -374,7 +374,7 @@ end
--- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base. --- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated. -- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated.
-- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the AI_AIR. -- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, while a new AIControllable is targeted to the AI_AIR.
-- Once the time is finished, the old AI will return to the base. -- Once the time is finished, the old AI will return to the base.
-- @param #AI_AIR self -- @param #AI_AIR self
-- @param #number FuelThresholdPercentage The threshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel. -- @param #number FuelThresholdPercentage The threshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.
@@ -409,7 +409,7 @@ end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{AI.AI_Patrol#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_AIR self -- @param #AI_AIR self
-- @return #AI_AIR self -- @return #AI_AIR self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
@@ -473,27 +473,27 @@ function AI_AIR:onafterStatus()
-- self:Home( "Destroy" ) -- self:Home( "Destroy" )
-- end -- end
-- end -- end
if not self:Is( "Fuel" ) and not self:Is( "Home" ) and not self:is( "Refuelling" )then if not self:Is( "Fuel" ) and not self:Is( "Home" ) and not self:is( "Refuelling" )then
local Fuel = self.Controllable:GetFuelMin() local Fuel = self.Controllable:GetFuelMin()
-- If the fuel in the controllable is below the threshold percentage, -- If the fuel in the controllable is below the threshold percentage,
-- then send for refuel in case of a tanker, otherwise RTB. -- then send for refuel in case of a tanker, otherwise RTB.
if Fuel < self.FuelThresholdPercentage then if Fuel < self.FuelThresholdPercentage then
if self.TankerName then if self.TankerName then
self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... Refuelling at Tanker!" ) self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... Refuelling at Tanker!" )
self:Refuel() self:Refuel()
else else
self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" ) self:I( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" )
local OldAIControllable = self.Controllable local OldAIControllable = self.Controllable
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed ) local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
local TimedOrbitTask = OldAIControllable:TaskControlled( OrbitTask, OldAIControllable:TaskCondition(nil,nil,nil,nil,self.OutOfFuelOrbitTime,nil ) ) local TimedOrbitTask = OldAIControllable:TaskControlled( OrbitTask, OldAIControllable:TaskCondition(nil,nil,nil,nil,self.OutOfFuelOrbitTime,nil ) )
OldAIControllable:SetTask( TimedOrbitTask, 10 ) OldAIControllable:SetTask( TimedOrbitTask, 10 )
self:Fuel() self:Fuel()
RTB = true RTB = true
end end
@@ -504,11 +504,11 @@ function AI_AIR:onafterStatus()
if self:Is( "Fuel" ) and not self:Is( "Home" ) and not self:is( "Refuelling" ) then if self:Is( "Fuel" ) and not self:Is( "Home" ) and not self:is( "Refuelling" ) then
RTB = true RTB = true
end end
-- TODO: Check GROUP damage function. -- TODO: Check GROUP damage function.
local Damage = self.Controllable:GetLife() local Damage = self.Controllable:GetLife()
local InitialLife = self.Controllable:GetLife0() local InitialLife = self.Controllable:GetLife0()
-- If the group is damaged, then RTB. -- If the group is damaged, then RTB.
-- Note that a group can consist of more units, so if one unit is damaged of a group, the mission may continue. -- Note that a group can consist of more units, so if one unit is damaged of a group, the mission may continue.
-- The damaged unit will RTB due to DCS logic, and the others will continue to engage. -- The damaged unit will RTB due to DCS logic, and the others will continue to engage.
@@ -518,7 +518,7 @@ function AI_AIR:onafterStatus()
RTB = true RTB = true
self:SetStatusOff() self:SetStatusOff()
end end
-- Check if planes went RTB and are out of control. -- Check if planes went RTB and are out of control.
-- We only check if planes are out of control, when they are in duty. -- We only check if planes are out of control, when they are in duty.
if self.Controllable:HasTask() == false then if self.Controllable:HasTask() == false then
@@ -532,7 +532,7 @@ function AI_AIR:onafterStatus()
self:Damaged() self:Damaged()
else else
self:I( self.Controllable:GetName() .. " control lost! " ) self:I( self.Controllable:GetName() .. " control lost! " )
self:LostControl() self:LostControl()
end end
else else
@@ -550,7 +550,7 @@ function AI_AIR:onafterStatus()
if not self:Is("Home") then if not self:Is("Home") then
self:__Status( 10 ) self:__Status( 10 )
end end
end end
end end
@@ -559,11 +559,11 @@ end
function AI_AIR.RTBRoute( AIGroup, Fsm ) function AI_AIR.RTBRoute( AIGroup, Fsm )
AIGroup:F( { "AI_AIR.RTBRoute:", AIGroup:GetName() } ) AIGroup:F( { "AI_AIR.RTBRoute:", AIGroup:GetName() } )
if AIGroup:IsAlive() then if AIGroup:IsAlive() then
Fsm:RTB() Fsm:RTB()
end end
end end
--- @param Wrapper.Group#GROUP AIGroup --- @param Wrapper.Group#GROUP AIGroup
@@ -576,7 +576,7 @@ function AI_AIR.RTBHold( AIGroup, Fsm )
local Task = AIGroup:TaskOrbitCircle( 4000, 400 ) local Task = AIGroup:TaskOrbitCircle( 4000, 400 )
AIGroup:SetTask( Task ) AIGroup:SetTask( Task )
end end
end end
--- Set the min and max factors on RTB speed. Use this, if your planes are heading back to base too fast. Default values are 0.5 and 0.6. --- Set the min and max factors on RTB speed. Use this, if your planes are heading back to base too fast. Default values are 0.5 and 0.6.
@@ -598,54 +598,53 @@ end
function AI_AIR:onafterRTB( AIGroup, From, Event, To ) function AI_AIR:onafterRTB( AIGroup, From, Event, To )
self:F( { AIGroup, From, Event, To } ) self:F( { AIGroup, From, Event, To } )
if AIGroup and AIGroup:IsAlive() then
if AIGroup and AIGroup:IsAlive() then
self:T( "Group " .. AIGroup:GetName() .. " ... RTB! ( " .. self:GetState() .. " )" ) self:T( "Group " .. AIGroup:GetName() .. " ... RTB! ( " .. self:GetState() .. " )" )
self:ClearTargetDistance() self:ClearTargetDistance()
--AIGroup:ClearTasks() --AIGroup:ClearTasks()
AIGroup:OptionProhibitAfterburner(true) AIGroup:OptionProhibitAfterburner(true)
local EngageRoute = {} local EngageRoute = {}
--- Calculate the target route point. --- Calculate the target route point.
local FromCoord = AIGroup:GetCoordinate() local FromCoord = AIGroup:GetCoordinate()
local ToTargetCoord = self.HomeAirbase:GetCoordinate() -- coordinate is on land height(!) local ToTargetCoord = self.HomeAirbase:GetCoordinate() -- coordinate is on land height(!)
local ToTargetVec3 = ToTargetCoord:GetVec3() local ToTargetVec3 = ToTargetCoord:GetVec3()
ToTargetVec3.y = ToTargetCoord:GetLandHeight()+3000 -- let's set this 1000m/3000 feet above ground ToTargetVec3.y = ToTargetCoord:GetLandHeight()+3000 -- let's set this 1000m/3000 feet above ground
local ToTargetCoord2 = COORDINATE:NewFromVec3( ToTargetVec3 ) local ToTargetCoord2 = COORDINATE:NewFromVec3( ToTargetVec3 )
if not self.RTBMinSpeed or not self.RTBMaxSpeed then if not self.RTBMinSpeed or not self.RTBMaxSpeed then
local RTBSpeedMax = AIGroup:GetSpeedMax() local RTBSpeedMax = AIGroup:GetSpeedMax()
local RTBSpeedMaxFactor = self.RTBSpeedMaxFactor or 0.6 local RTBSpeedMaxFactor = self.RTBSpeedMaxFactor or 0.6
local RTBSpeedMinFactor = self.RTBSpeedMinFactor or 0.5 local RTBSpeedMinFactor = self.RTBSpeedMinFactor or 0.5
self:SetRTBSpeed( RTBSpeedMax * RTBSpeedMinFactor, RTBSpeedMax * RTBSpeedMaxFactor) self:SetRTBSpeed( RTBSpeedMax * RTBSpeedMinFactor, RTBSpeedMax * RTBSpeedMaxFactor)
end end
local RTBSpeed = math.random( self.RTBMinSpeed, self.RTBMaxSpeed ) local RTBSpeed = math.random( self.RTBMinSpeed, self.RTBMaxSpeed )
--local ToAirbaseAngle = FromCoord:GetAngleDegrees( FromCoord:GetDirectionVec3( ToTargetCoord2 ) ) --local ToAirbaseAngle = FromCoord:GetAngleDegrees( FromCoord:GetDirectionVec3( ToTargetCoord2 ) )
local Distance = FromCoord:Get2DDistance( ToTargetCoord2 ) local Distance = FromCoord:Get2DDistance( ToTargetCoord2 )
--local ToAirbaseCoord = FromCoord:Translate( 5000, ToAirbaseAngle ) --local ToAirbaseCoord = FromCoord:Translate( 5000, ToAirbaseAngle )
local ToAirbaseCoord = ToTargetCoord2 local ToAirbaseCoord = ToTargetCoord2
if Distance < 5000 then if Distance < 5000 then
self:I( "RTB and near the airbase!" ) self:I( "RTB and near the airbase!" )
self:Home() self:Home()
return return
end end
if not AIGroup:InAir() == true then if not AIGroup:InAir() == true then
self:I( "Not anymore in the air, considered Home." ) self:I( "Not anymore in the air, considered Home." )
self:Home() self:Home()
return return
end end
--- Create a route point of type air. --- Create a route point of type air.
local FromRTBRoutePoint = FromCoord:WaypointAir( local FromRTBRoutePoint = FromCoord:WaypointAir(
self.PatrolAltType, self.PatrolAltType,
@@ -666,10 +665,10 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
EngageRoute[#EngageRoute+1] = FromRTBRoutePoint EngageRoute[#EngageRoute+1] = FromRTBRoutePoint
EngageRoute[#EngageRoute+1] = ToRTBRoutePoint EngageRoute[#EngageRoute+1] = ToRTBRoutePoint
local Tasks = {} local Tasks = {}
Tasks[#Tasks+1] = AIGroup:TaskFunction( "AI_AIR.RTBRoute", self ) Tasks[#Tasks+1] = AIGroup:TaskFunction( "AI_AIR.RTBRoute", self )
EngageRoute[#EngageRoute].task = AIGroup:TaskCombo( Tasks ) EngageRoute[#EngageRoute].task = AIGroup:TaskCombo( Tasks )
AIGroup:OptionROEHoldFire() AIGroup:OptionROEHoldFire()
@@ -677,9 +676,9 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
--- NOW ROUTE THE GROUP! --- NOW ROUTE THE GROUP!
AIGroup:Route( EngageRoute, self.TaskDelay ) AIGroup:Route( EngageRoute, self.TaskDelay )
end end
end end
--- @param #AI_AIR self --- @param #AI_AIR self
@@ -7,7 +7,7 @@
-- * Setup quickly an AIR defense system for a coalition. -- * Setup quickly an AIR defense system for a coalition.
-- * Setup multiple defense zones to defend specific coordinates in your battlefield. -- * Setup multiple defense zones to defend specific coordinates in your battlefield.
-- * Setup (SEAD) Suppression of Air Defense squadrons, to gain control in the air of enemy grounds. -- * Setup (SEAD) Suppression of Air Defense squadrons, to gain control in the air of enemy grounds.
-- * Setup (CAS) Controlled Air Support squadrons, to attack closeby enemy ground units near friendly installations. -- * Setup (CAS) Controlled Air Support squadrons, to attack close by enemy ground units near friendly installations.
-- * Setup (BAI) Battleground Air Interdiction squadrons to attack remote enemy ground units and targets. -- * Setup (BAI) Battleground Air Interdiction squadrons to attack remote enemy ground units and targets.
-- * Define and use a detection network controlled by recce. -- * Define and use a detection network controlled by recce.
-- * Define AIR defense squadrons at airbases, FARPs and carriers. -- * Define AIR defense squadrons at airbases, FARPs and carriers.
@@ -24,7 +24,7 @@
-- --
-- ## Missions: -- ## Missions:
-- --
-- [AID-AIR - AI AIR Dispatching](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/AID%20-%20AI%20Dispatching/AID-AIR%20-%20AI%20AIR%20Dispatching) -- [AID-AIR - AI AIR Dispatching](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/AID%20-%20AI%20Dispatching)
-- --
-- === -- ===
-- --
@@ -88,7 +88,7 @@
-- --
-- ## 4. How do the defenses decide **when and where to engage** on approaching enemy units? -- ## 4. How do the defenses decide **when and where to engage** on approaching enemy units?
-- --
-- The AIR dispacher needs you to setup (various) defense coordinates, which are strategic positions in the battle field to be defended. -- The AIR dispatcher needs you to setup (various) defense coordinates, which are strategic positions in the battle field to be defended.
-- Any ground based enemy approaching within the proximity of such a defense point, may trigger for a defensive action by friendly air units. -- Any ground based enemy approaching within the proximity of such a defense point, may trigger for a defensive action by friendly air units.
-- --
-- There are 2 important parameters that play a role in the defensive decision making: defensiveness and reactivity. -- There are 2 important parameters that play a role in the defensive decision making: defensiveness and reactivity.
@@ -108,7 +108,7 @@
-- ## 5. Are defense coordinates and defense reactivity the only parameters? -- ## 5. Are defense coordinates and defense reactivity the only parameters?
-- --
-- No, depending on the target type, and the threat level of the target, the probability of defense will be higher. -- No, depending on the target type, and the threat level of the target, the probability of defense will be higher.
-- In other words, when a SAM-10 radar emitter is detected, its probabilty for defense will be much higher than when a BMP-1 vehicle is -- In other words, when a SAM-10 radar emitter is detected, its probability for defense will be much higher than when a BMP-1 vehicle is
-- detected, even when both enemies are at the same distance from a defense coordinate. -- detected, even when both enemies are at the same distance from a defense coordinate.
-- This will ensure optimal defenses, SEAD tasks will be launched much more quicker against engaging radar emitters, to ensure air superiority. -- This will ensure optimal defenses, SEAD tasks will be launched much more quicker against engaging radar emitters, to ensure air superiority.
-- Approaching main battle tanks will be engaged much faster, than a group of approaching trucks. -- Approaching main battle tanks will be engaged much faster, than a group of approaching trucks.
@@ -117,12 +117,12 @@
-- ## 6. Which Squadrons will I create and which name will I give each Squadron? -- ## 6. Which Squadrons will I create and which name will I give each Squadron?
-- --
-- The AIR defense system works with **Squadrons**. Each Squadron must be given a unique name, that forms the **key** to the squadron. -- The AIR defense system works with **Squadrons**. Each Squadron must be given a unique name, that forms the **key** to the squadron.
-- Several options and activities can be set per Squadron. A free format name can be given, but always ensure that the name is meaningfull -- Several options and activities can be set per Squadron. A free format name can be given, but always ensure that the name is meaningful
-- for your mission, and remember that squadron names are used for communication to the players of your mission. -- for your mission, and remember that squadron names are used for communication to the players of your mission.
-- --
-- There are mainly 3 types of defenses: **SEAD**, **CAS** and **BAI**. -- There are mainly 3 types of defenses: **SEAD**, **CAS** and **BAI**.
-- --
-- Suppression of Air Defenses (SEAD) are effective agains radar emitters. Close Air Support (CAS) is launched when the enemy is close near friendly units. -- Suppression of Air Defenses (SEAD) are effective against radar emitters. Close Air Support (CAS) is launched when the enemy is close near friendly units.
-- Battleground Air Interdiction (BAI) tasks are launched when there are no friendlies around. -- Battleground Air Interdiction (BAI) tasks are launched when there are no friendlies around.
-- --
-- Depending on the defense type, different payloads will be needed. See further points on squadron definition. -- Depending on the defense type, different payloads will be needed. See further points on squadron definition.
@@ -174,13 +174,13 @@
-- * polygon zones -- * polygon zones
-- * moving zones -- * moving zones
-- --
-- Depending on the type of zone selected, a different @{Zone} object needs to be created from a ZONE_ class. -- Depending on the type of zone selected, a different @{Core.Zone} object needs to be created from a ZONE_ class.
-- --
-- --
-- ## 12. Are moving defense coordinates possible? -- ## 12. Are moving defense coordinates possible?
-- --
-- Yes, different COORDINATE types are possible to be used. -- Yes, different COORDINATE types are possible to be used.
-- The COORDINATE_UNIT will help you to specify a defense coodinate that is attached to a moving unit. -- The COORDINATE_UNIT will help you to specify a defense coordinate that is attached to a moving unit.
-- --
-- --
-- ## 13. How much defense coordinates do I need to create? -- ## 13. How much defense coordinates do I need to create?
@@ -214,7 +214,7 @@
-- * From a parking spot with running engines -- * From a parking spot with running engines
-- * From a parking spot with cold engines -- * From a parking spot with cold engines
-- --
-- **The default takeoff method is staight in the air.** -- **The default takeoff method is straight in the air.**
-- This takeoff method is the most useful if you want to avoid airplane clutter at airbases! -- This takeoff method is the most useful if you want to avoid airplane clutter at airbases!
-- But it is the least realistic one! -- But it is the least realistic one!
-- --
@@ -236,10 +236,10 @@
-- --
-- For each Squadron, depending on the helicopter or airplane type (modern, old) and payload, which overhead is required to provide any defense? -- For each Squadron, depending on the helicopter or airplane type (modern, old) and payload, which overhead is required to provide any defense?
-- --
-- In other words, if **X** enemy ground units are detected, how many **Y** defense helicpters or airplanes need to engage (per squadron)? -- In other words, if **X** enemy ground units are detected, how many **Y** defense helicopters or airplanes need to engage (per squadron)?
-- The **Y** is dependent on the type of airplane (era), payload, fuel levels, skills etc. -- The **Y** is dependent on the type of airplane (era), payload, fuel levels, skills etc.
-- But the most important factor is the payload, which is the amount of AIR weapons the defense can carry to attack the enemy ground units. -- But the most important factor is the payload, which is the amount of AIR weapons the defense can carry to attack the enemy ground units.
-- For example, a Ka-50 can carry 16 vikrs, that means, that it potentially can destroy at least 8 ground units without a reload of ammunication. -- For example, a Ka-50 can carry 16 vikrs, that means, that it potentially can destroy at least 8 ground units without a reload of ammunition.
-- That means, that one defender can destroy more enemy ground units. -- That means, that one defender can destroy more enemy ground units.
-- Thus, the overhead is a **factor** that will calculate dynamically how many **Y** defenses will be required based on **X** attackers detected. -- Thus, the overhead is a **factor** that will calculate dynamically how many **Y** defenses will be required based on **X** attackers detected.
-- --
@@ -279,7 +279,7 @@ do -- AI_AIR_DISPATCHER
-- Multiple defense coordinates can be setup. Defense coordinates can be strategic or tactical positions or references to strategic units or scenery. -- Multiple defense coordinates can be setup. Defense coordinates can be strategic or tactical positions or references to strategic units or scenery.
-- The AIR dispatcher will evaluate every x seconds the tactical situation around each defense coordinate. When a defense coordinate -- The AIR dispatcher will evaluate every x seconds the tactical situation around each defense coordinate. When a defense coordinate
-- is under threat, it will communicate through the command center that defensive actions need to be taken and will launch groups of air units for defense. -- is under threat, it will communicate through the command center that defensive actions need to be taken and will launch groups of air units for defense.
-- The level of threat to the defense coordinate varyies upon the strength and types of the enemy units, the distance to the defense point, and the defensiveness parameters. -- The level of threat to the defense coordinate varies upon the strength and types of the enemy units, the distance to the defense point, and the defensiveness parameters.
-- Defensive actions are taken through probability, but the closer and the more threat the enemy poses to the defense coordinate, the faster it will be attacked by friendly AIR units. -- Defensive actions are taken through probability, but the closer and the more threat the enemy poses to the defense coordinate, the faster it will be attacked by friendly AIR units.
-- --
-- Please study carefully the underlying explanations how to setup and use this module, as it has many features. -- Please study carefully the underlying explanations how to setup and use this module, as it has many features.
@@ -328,7 +328,7 @@ do -- AI_AIR_DISPATCHER
-- By spawning in dynamically additional recce, you can ensure that there is sufficient reconnaissance coverage so the defense mechanism is continuously -- By spawning in dynamically additional recce, you can ensure that there is sufficient reconnaissance coverage so the defense mechanism is continuously
-- alerted of new enemy ground targets. -- alerted of new enemy ground targets.
-- --
-- The following example defens a new reconnaissance network using a @{Functional.Detection#DETECTION_AREAS} object. -- The following example defense a new reconnaissance network using a @{Functional.Detection#DETECTION_AREAS} object.
-- --
-- -- Define a SET_GROUP object that builds a collection of groups that define the recce network. -- -- Define a SET_GROUP object that builds a collection of groups that define the recce network.
-- -- Here we build the network with all the groups that have a name starting with CCCP Recce. -- -- Here we build the network with all the groups that have a name starting with CCCP Recce.
@@ -473,7 +473,7 @@ do -- AI_AIR_DISPATCHER
-- the mission designer can choose to increase or reduce the amount of planes spawned. -- the mission designer can choose to increase or reduce the amount of planes spawned.
-- --
-- The method @{#AI_AIR_DISPATCHER.SetSquadron}() defines for you a new squadron. -- The method @{#AI_AIR_DISPATCHER.SetSquadron}() defines for you a new squadron.
-- The provided parameters are the squadron name, airbase name and a list of template prefixe, and a number that indicates the amount of resources. -- The provided parameters are the squadron name, airbase name and a list of template prefixes, and a number that indicates the amount of resources.
-- --
-- For example, this defines 3 new squadrons: -- For example, this defines 3 new squadrons:
-- --
@@ -619,7 +619,7 @@ do -- AI_AIR_DISPATCHER
-- Depending on the demand of requested takeoffs by the AIR dispatcher, an airfield can become overloaded. Too many aircraft need to be taken -- Depending on the demand of requested takeoffs by the AIR dispatcher, an airfield can become overloaded. Too many aircraft need to be taken
-- off at the same time, which will result in clutter as described above. In order to better control this behaviour, a takeoff scheduler is implemented, -- off at the same time, which will result in clutter as described above. In order to better control this behaviour, a takeoff scheduler is implemented,
-- which can be used to control how many aircraft are ordered for takeoff between specific time intervals. -- which can be used to control how many aircraft are ordered for takeoff between specific time intervals.
-- The takeff intervals can be specified per squadron, which make sense, as each squadron have a "home" airfield. -- The takeoff intervals can be specified per squadron, which make sense, as each squadron have a "home" airfield.
-- --
-- For this purpose, the method @{#AI_AIR_DISPATCHER.SetSquadronTakeOffInterval}() can be used to specify the takeoff intervals of -- For this purpose, the method @{#AI_AIR_DISPATCHER.SetSquadronTakeOffInterval}() can be used to specify the takeoff intervals of
-- aircraft groups per squadron to avoid cluttering of aircraft at airbases. -- aircraft groups per squadron to avoid cluttering of aircraft at airbases.
@@ -1021,7 +1021,7 @@ do -- AI_AIR_DISPATCHER
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @param Tasking.Task_AIR#AI_AIR Task -- @param AI.AI_Air#AI_AIR Task
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @param #string PlayerName -- @param #string PlayerName
@@ -1376,7 +1376,7 @@ do -- AI_AIR_DISPATCHER
--- Define a border area to simulate a **cold war** scenario. --- Define a border area to simulate a **cold war** scenario.
-- A **cold war** is one where Patrol aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border. -- A **cold war** is one where Patrol aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border.
-- A **hot war** is one where Patrol aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send Patrol and GCI aircraft to attack it. -- A **hot war** is one where Patrol aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send Patrol and GCI aircraft to attack it.
-- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this. -- If it's a cold war then the **borders of red and blue territory** need to be defined using a @{Core.Zone} object derived from @{Core.Zone#ZONE_BASE}. This method needs to be used for this.
-- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1 -- If a hot war is chosen then **no borders** actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1
-- @param #AI_AIR_DISPATCHER self -- @param #AI_AIR_DISPATCHER self
-- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE. -- @param Core.Zone#ZONE_BASE BorderZone An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE.
+1 -1
View File
@@ -65,7 +65,7 @@
-- --
-- ![Zone](..\Presentations\AI_GCI\Dia12.JPG) -- ![Zone](..\Presentations\AI_GCI\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI.AI_CAP#AI_AIR_ENGAGE.SetEngageZone}() to define that Zone. -- Use the method @{AI.AI_CAP#AI_AIR_ENGAGE.SetEngageZone}() to define that Zone.
-- --
+51 -55
View File
@@ -12,8 +12,7 @@
--- @type AI_AIR_PATROL --- @type AI_AIR_PATROL
-- @extends AI.AI_Air#AI_AIR -- @extends AI.AI_Air#AI_AIR
--- The AI_AIR_PATROL class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group}
--- The AI_AIR_PATROL class implements the core functions to patrol a @{Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone. -- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
-- --
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG) -- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
@@ -86,7 +85,7 @@
-- --
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG) -- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI.AI_CAP#AI_AIR_PATROL.SetEngageZone}() to define that Zone. -- Use the method @{AI.AI_CAP#AI_AIR_PATROL.SetEngageZone}() to define that Zone.
-- --
@@ -101,7 +100,7 @@ AI_AIR_PATROL = {
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @param AI.AI_Air#AI_AIR AI_Air The AI_AIR FSM. -- @param AI.AI_Air#AI_AIR AI_Air The AI_AIR FSM.
-- @param Wrapper.Group#GROUP AIGroup The AI group. -- @param Wrapper.Group#GROUP AIGroup The AI group.
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude (optional, default = 1000m ) The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude (optional, default = 1000m ) The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude (optional, default = 1500m ) The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude (optional, default = 1500m ) The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed of the @{Wrapper.Group} in km/h. -- @param DCS#Speed PatrolMinSpeed (optional, default = 50% of max speed) The minimum speed of the @{Wrapper.Group} in km/h.
@@ -114,17 +113,17 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
local self = BASE:Inherit( self, AI_Air ) -- #AI_AIR_PATROL local self = BASE:Inherit( self, AI_Air ) -- #AI_AIR_PATROL
local SpeedMax = AIGroup:GetSpeedMax() local SpeedMax = AIGroup:GetSpeedMax()
self.PatrolZone = PatrolZone self.PatrolZone = PatrolZone
self.PatrolFloorAltitude = PatrolFloorAltitude or 1000 self.PatrolFloorAltitude = PatrolFloorAltitude or 1000
self.PatrolCeilingAltitude = PatrolCeilingAltitude or 1500 self.PatrolCeilingAltitude = PatrolCeilingAltitude or 1500
self.PatrolMinSpeed = PatrolMinSpeed or SpeedMax * 0.5 self.PatrolMinSpeed = PatrolMinSpeed or SpeedMax * 0.5
self.PatrolMaxSpeed = PatrolMaxSpeed or SpeedMax * 0.75 self.PatrolMaxSpeed = PatrolMaxSpeed or SpeedMax * 0.75
-- defafult PatrolAltType to "RADIO" if not specified -- defafult PatrolAltType to "RADIO" if not specified
self.PatrolAltType = PatrolAltType or "RADIO" self.PatrolAltType = PatrolAltType or "RADIO"
self:AddTransition( { "Started", "Airborne", "Refuelling" }, "Patrol", "Patrolling" ) self:AddTransition( { "Started", "Airborne", "Refuelling" }, "Patrol", "Patrolling" )
--- OnBefore Transition Handler for Event Patrol. --- OnBefore Transition Handler for Event Patrol.
@@ -135,7 +134,7 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Patrol. --- OnAfter Transition Handler for Event Patrol.
-- @function [parent=#AI_AIR_PATROL] OnAfterPatrol -- @function [parent=#AI_AIR_PATROL] OnAfterPatrol
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
@@ -143,16 +142,16 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Patrol. --- Synchronous Event Trigger for Event Patrol.
-- @function [parent=#AI_AIR_PATROL] Patrol -- @function [parent=#AI_AIR_PATROL] Patrol
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
--- Asynchronous Event Trigger for Event Patrol. --- Asynchronous Event Trigger for Event Patrol.
-- @function [parent=#AI_AIR_PATROL] __Patrol -- @function [parent=#AI_AIR_PATROL] __Patrol
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @param #number Delay The delay in seconds. -- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Patrolling. --- OnLeave Transition Handler for State Patrolling.
-- @function [parent=#AI_AIR_PATROL] OnLeavePatrolling -- @function [parent=#AI_AIR_PATROL] OnLeavePatrolling
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
@@ -161,7 +160,7 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Patrolling. --- OnEnter Transition Handler for State Patrolling.
-- @function [parent=#AI_AIR_PATROL] OnEnterPatrolling -- @function [parent=#AI_AIR_PATROL] OnEnterPatrolling
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
@@ -169,9 +168,9 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
self:AddTransition( "Patrolling", "PatrolRoute", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_AIR_PATROL. self:AddTransition( "Patrolling", "PatrolRoute", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_AIR_PATROL.
--- OnBefore Transition Handler for Event PatrolRoute. --- OnBefore Transition Handler for Event PatrolRoute.
-- @function [parent=#AI_AIR_PATROL] OnBeforePatrolRoute -- @function [parent=#AI_AIR_PATROL] OnBeforePatrolRoute
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
@@ -180,7 +179,7 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event PatrolRoute. --- OnAfter Transition Handler for Event PatrolRoute.
-- @function [parent=#AI_AIR_PATROL] OnAfterPatrolRoute -- @function [parent=#AI_AIR_PATROL] OnAfterPatrolRoute
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
@@ -188,23 +187,21 @@ function AI_AIR_PATROL:New( AI_Air, AIGroup, PatrolZone, PatrolFloorAltitude, Pa
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event PatrolRoute. --- Synchronous Event Trigger for Event PatrolRoute.
-- @function [parent=#AI_AIR_PATROL] PatrolRoute -- @function [parent=#AI_AIR_PATROL] PatrolRoute
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
--- Asynchronous Event Trigger for Event PatrolRoute. --- Asynchronous Event Trigger for Event PatrolRoute.
-- @function [parent=#AI_AIR_PATROL] __PatrolRoute -- @function [parent=#AI_AIR_PATROL] __PatrolRoute
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @param #number Delay The delay in seconds. -- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_AIR_PATROL. self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_AIR_PATROL.
return self return self
end end
--- Set the Engage Range when the AI will engage with airborne enemies. --- Set the Engage Range when the AI will engage with airborne enemies.
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @param #number EngageRange The Engage Range. -- @param #number EngageRange The Engage Range.
@@ -230,7 +227,7 @@ end
-- @param #table CapCoordinates Table of coordinates of first race track point. Second point is determined by leg length and heading. -- @param #table CapCoordinates Table of coordinates of first race track point. Second point is determined by leg length and heading.
-- @return #AI_AIR_PATROL self -- @return #AI_AIR_PATROL self
function AI_AIR_PATROL:SetRaceTrackPattern(LegMin, LegMax, HeadingMin, HeadingMax, DurationMin, DurationMax, CapCoordinates) function AI_AIR_PATROL:SetRaceTrackPattern(LegMin, LegMax, HeadingMin, HeadingMax, DurationMin, DurationMax, CapCoordinates)
self.racetrack=true self.racetrack=true
self.racetracklegmin=LegMin or 10000 self.racetracklegmin=LegMin or 10000
self.racetracklegmax=LegMax or 15000 self.racetracklegmax=LegMax or 15000
@@ -238,18 +235,16 @@ function AI_AIR_PATROL:SetRaceTrackPattern(LegMin, LegMax, HeadingMin, HeadingMa
self.racetrackheadingmax=HeadingMax or 180 self.racetrackheadingmax=HeadingMax or 180
self.racetrackdurationmin=DurationMin self.racetrackdurationmin=DurationMin
self.racetrackdurationmax=DurationMax self.racetrackdurationmax=DurationMax
if self.racetrackdurationmax and not self.racetrackdurationmin then if self.racetrackdurationmax and not self.racetrackdurationmin then
self.racetrackdurationmin=self.racetrackdurationmax self.racetrackdurationmin=self.racetrackdurationmax
end end
self.racetrackcapcoordinates=CapCoordinates self.racetrackcapcoordinates=CapCoordinates
end end
--- Defines a new patrol route using the @{AI.AI_Patrol#AI_PATROL_ZONE} parameters and settings.
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings.
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @return #AI_AIR_PATROL self -- @return #AI_AIR_PATROL self
-- @param Wrapper.Group#GROUP AIPatrol The Group Object managed by the FSM. -- @param Wrapper.Group#GROUP AIPatrol The Group Object managed by the FSM.
@@ -262,7 +257,7 @@ function AI_AIR_PATROL:onafterPatrol( AIPatrol, From, Event, To )
self:ClearTargetDistance() self:ClearTargetDistance()
self:__PatrolRoute( self.TaskDelay ) self:__PatrolRoute( self.TaskDelay )
AIPatrol:OnReSpawn( AIPatrol:OnReSpawn(
function( PatrolGroup ) function( PatrolGroup )
self:__Reset( self.TaskDelay ) self:__Reset( self.TaskDelay )
@@ -271,7 +266,7 @@ function AI_AIR_PATROL:onafterPatrol( AIPatrol, From, Event, To )
) )
end end
--- This statis method is called from the route path within the last task at the last waaypoint of the AIPatrol. --- This static method is called from the route path within the last task at the last waypoint of the AIPatrol.
-- Note that this method is required, as triggers the next route when patrolling for the AIPatrol. -- Note that this method is required, as triggers the next route when patrolling for the AIPatrol.
-- @param Wrapper.Group#GROUP AIPatrol The AI group. -- @param Wrapper.Group#GROUP AIPatrol The AI group.
-- @param #AI_AIR_PATROL Fsm The FSM. -- @param #AI_AIR_PATROL Fsm The FSM.
@@ -282,10 +277,10 @@ function AI_AIR_PATROL.___PatrolRoute( AIPatrol, Fsm )
if AIPatrol and AIPatrol:IsAlive() then if AIPatrol and AIPatrol:IsAlive() then
Fsm:PatrolRoute() Fsm:PatrolRoute()
end end
end end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{AI.AI_Patrol#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_AIR_PATROL self -- @param #AI_AIR_PATROL self
-- @param Wrapper.Group#GROUP AIPatrol The Group managed by the FSM. -- @param Wrapper.Group#GROUP AIPatrol The Group managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
@@ -300,21 +295,20 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
return return
end end
if AIPatrol and AIPatrol:IsAlive() then if AIPatrol and AIPatrol:IsAlive() then
local PatrolRoute = {} local PatrolRoute = {}
--- Calculate the target route point. --- Calculate the target route point.
local CurrentCoord = AIPatrol:GetCoordinate() local CurrentCoord = AIPatrol:GetCoordinate()
local altitude= math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ) local altitude= math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude )
local ToTargetCoord = self.PatrolZone:GetRandomPointVec2() local ToTargetCoord = self.PatrolZone:GetRandomPointVec2()
ToTargetCoord:SetAlt( altitude ) ToTargetCoord:SetAlt( altitude )
self:SetTargetDistance( ToTargetCoord ) -- For RTB status check self:SetTargetDistance( ToTargetCoord ) -- For RTB status check
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed ) local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
local speedkmh=ToTargetSpeed local speedkmh=ToTargetSpeed
@@ -322,31 +316,31 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
PatrolRoute[#PatrolRoute+1] = FromWP PatrolRoute[#PatrolRoute+1] = FromWP
if self.racetrack then if self.racetrack then
-- Random heading. -- Random heading.
local heading = math.random(self.racetrackheadingmin, self.racetrackheadingmax) local heading = math.random(self.racetrackheadingmin, self.racetrackheadingmax)
-- Random leg length. -- Random leg length.
local leg=math.random(self.racetracklegmin, self.racetracklegmax) local leg=math.random(self.racetracklegmin, self.racetracklegmax)
-- Random duration if any. -- Random duration if any.
local duration = self.racetrackdurationmin local duration = self.racetrackdurationmin
if self.racetrackdurationmax then if self.racetrackdurationmax then
duration=math.random(self.racetrackdurationmin, self.racetrackdurationmax) duration=math.random(self.racetrackdurationmin, self.racetrackdurationmax)
end end
-- CAP coordinate. -- CAP coordinate.
local c0=self.PatrolZone:GetRandomCoordinate() local c0=self.PatrolZone:GetRandomCoordinate()
if self.racetrackcapcoordinates and #self.racetrackcapcoordinates>0 then if self.racetrackcapcoordinates and #self.racetrackcapcoordinates>0 then
c0=self.racetrackcapcoordinates[math.random(#self.racetrackcapcoordinates)] c0=self.racetrackcapcoordinates[math.random(#self.racetrackcapcoordinates)]
end end
-- Race track points. -- Race track points.
local c1=c0:SetAltitude(altitude) --Core.Point#COORDINATE local c1=c0:SetAltitude(altitude) --Core.Point#COORDINATE
local c2=c1:Translate(leg, heading):SetAltitude(altitude) local c2=c1:Translate(leg, heading):SetAltitude(altitude)
self:SetTargetDistance(c0) -- For RTB status check self:SetTargetDistance(c0) -- For RTB status check
-- Debug: -- Debug:
self:T(string.format("Patrol zone race track: v=%.1f knots, h=%.1f ft, heading=%03d, leg=%d m, t=%s sec", UTILS.KmphToKnots(speedkmh), UTILS.MetersToFeet(altitude), heading, leg, tostring(duration))) self:T(string.format("Patrol zone race track: v=%.1f knots, h=%.1f ft, heading=%03d, leg=%d m, t=%s sec", UTILS.KmphToKnots(speedkmh), UTILS.MetersToFeet(altitude), heading, leg, tostring(duration)))
--c1:MarkToAll("Race track c1") --c1:MarkToAll("Race track c1")
@@ -354,39 +348,41 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
-- Task to orbit. -- Task to orbit.
local taskOrbit=AIPatrol:TaskOrbit(c1, altitude, UTILS.KmphToMps(speedkmh), c2) local taskOrbit=AIPatrol:TaskOrbit(c1, altitude, UTILS.KmphToMps(speedkmh), c2)
-- Task function to redo the patrol at other random position. -- Task function to redo the patrol at other random position.
local taskPatrol=AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self) local taskPatrol=AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self)
-- Controlled task with task condition. -- Controlled task with task condition.
local taskCond=AIPatrol:TaskCondition(nil, nil, nil, nil, duration, nil) local taskCond=AIPatrol:TaskCondition(nil, nil, nil, nil, duration, nil)
local taskCont=AIPatrol:TaskControlled(taskOrbit, taskCond) local taskCont=AIPatrol:TaskControlled(taskOrbit, taskCond)
-- Second waypoint -- Second waypoint
PatrolRoute[2]=c1:WaypointAirTurningPoint(self.PatrolAltType, speedkmh, {taskCont, taskPatrol}, "CAP Orbit") PatrolRoute[2]=c1:WaypointAirTurningPoint(self.PatrolAltType, speedkmh, {taskCont, taskPatrol}, "CAP Orbit")
else else
--- Create a route point of type air. --- Create a route point of type air.
local ToWP = ToTargetCoord:WaypointAir(self.PatrolAltType, POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToTargetSpeed, true) local ToWP = ToTargetCoord:WaypointAir(self.PatrolAltType, POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToTargetSpeed, true)
PatrolRoute[#PatrolRoute+1] = ToWP PatrolRoute[#PatrolRoute+1] = ToWP
local Tasks = {} local Tasks = {}
Tasks[#Tasks+1] = AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self) Tasks[#Tasks+1] = AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self)
PatrolRoute[#PatrolRoute].task = AIPatrol:TaskCombo( Tasks ) PatrolRoute[#PatrolRoute].task = AIPatrol:TaskCombo( Tasks )
end end
AIPatrol:OptionROEReturnFire() AIPatrol:OptionROEReturnFire()
AIPatrol:OptionROTEvadeFire() AIPatrol:OptionROTEvadeFire()
AIPatrol:Route( PatrolRoute, self.TaskDelay ) AIPatrol:Route( PatrolRoute, self.TaskDelay )
end end
end end
--- @param Wrapper.Group#GROUP AIPatrol --- Resumes the AIPatrol
-- @param Wrapper.Group#GROUP AIPatrol
-- @param Core.Fsm#FSM Fsm
function AI_AIR_PATROL.Resume( AIPatrol, Fsm ) function AI_AIR_PATROL.Resume( AIPatrol, Fsm )
AIPatrol:F( { "AI_AIR_PATROL.Resume:", AIPatrol:GetName() } ) AIPatrol:F( { "AI_AIR_PATROL.Resume:", AIPatrol:GetName() } )
@@ -394,5 +390,5 @@ function AI_AIR_PATROL.Resume( AIPatrol, Fsm )
Fsm:__Reset( Fsm.TaskDelay ) Fsm:__Reset( Fsm.TaskDelay )
Fsm:__PatrolRoute( Fsm.TaskDelay ) Fsm:__PatrolRoute( Fsm.TaskDelay )
end end
end end
+4 -4
View File
@@ -33,10 +33,10 @@
--- AI_BAI_ZONE class --- AI_BAI_ZONE class
-- @type AI_BAI_ZONE -- @type AI_BAI_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling. -- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed. -- @field Core.Zone#ZONE_BASE TargetZone The @{Core.Zone} where the patrol needs to be executed.
-- @extends AI.AI_Patrol#AI_PATROL_ZONE -- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- Implements the core functions to provide BattleGround Air Interdiction in an Engage @{Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}. --- Implements the core functions to provide BattleGround Air Interdiction in an Engage @{Core.Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}.
-- --
-- The AI_BAI_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone. -- The AI_BAI_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
-- --
@@ -142,7 +142,7 @@ AI_BAI_ZONE = {
--- Creates a new AI_BAI_ZONE object --- Creates a new AI_BAI_ZONE object
-- @param #AI_BAI_ZONE self -- @param #AI_BAI_ZONE self
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h.
@@ -566,7 +566,7 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
EngageRoute[#EngageRoute].task = Controllable:TaskCombo( AttackTasks ) EngageRoute[#EngageRoute].task = Controllable:TaskCombo( AttackTasks )
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone. --- Define a random point in the @{Core.Zone}. The AI will fly to that point within the zone.
--- Find a random 2D point in EngageZone. --- Find a random 2D point in EngageZone.
local ToTargetVec2 = self.EngageZone:GetRandomVec2() local ToTargetVec2 = self.EngageZone:GetRandomVec2()
+48 -63
View File
@@ -6,7 +6,6 @@
-- * Trigger detected events when enemy airplanes are detected. -- * Trigger detected events when enemy airplanes are detected.
-- * Manage a fuel threshold to RTB on time. -- * Manage a fuel threshold to RTB on time.
-- * Engage the enemy when detected. -- * Engage the enemy when detected.
--
-- --
-- === -- ===
-- --
@@ -19,27 +18,25 @@
-- === -- ===
-- --
-- ### Author: **FlightControl** -- ### Author: **FlightControl**
-- ### Contributions: -- ### Contributions:
-- --
-- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing. -- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing.
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing. -- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing.
-- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision. -- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision.
-- * **[Whisper](http://forums.eagle.ru/member.php?u=3829): Testing. -- * **[Whisper](http://forums.eagle.ru/member.php?u=3829): Testing.
-- * **[Delta99](https://forums.eagle.ru/member.php?u=125166): Testing. -- * **[Delta99](https://forums.eagle.ru/member.php?u=125166): Testing.
-- --
-- === -- ===
-- --
-- @module AI.AI_CAP -- @module AI.AI_CAP
-- @image AI_Combat_Air_Patrol.JPG -- @image AI_Combat_Air_Patrol.JPG
--- @type AI_CAP_ZONE --- @type AI_CAP_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling. -- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed. -- @field Core.Zone#ZONE_BASE TargetZone The @{Core.Zone} where the patrol needs to be executed.
-- @extends AI.AI_Patrol#AI_PATROL_ZONE -- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}
--- Implements the core functions to patrol a @{Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone. -- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
-- --
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG) -- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
@@ -112,7 +109,7 @@
-- --
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG) -- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
-- --
-- An optional @{Zone} can be set, -- An optional @{Core.Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets. -- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{#AI_CAP_ZONE.SetEngageZone}() to define that Zone. -- Use the method @{#AI_CAP_ZONE.SetEngageZone}() to define that Zone.
-- --
@@ -123,11 +120,9 @@ AI_CAP_ZONE = {
ClassName = "AI_CAP_ZONE", ClassName = "AI_CAP_ZONE",
} }
--- Creates a new AI_CAP_ZONE object --- Creates a new AI_CAP_ZONE object
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h.
@@ -141,7 +136,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
self.Accomplished = false self.Accomplished = false
self.Engaging = false self.Engaging = false
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE. self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Engage. --- OnBefore Transition Handler for Event Engage.
@@ -152,7 +147,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Engage. --- OnAfter Transition Handler for Event Engage.
-- @function [parent=#AI_CAP_ZONE] OnAfterEngage -- @function [parent=#AI_CAP_ZONE] OnAfterEngage
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -160,11 +155,11 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Engage. --- Synchronous Event Trigger for Event Engage.
-- @function [parent=#AI_CAP_ZONE] Engage -- @function [parent=#AI_CAP_ZONE] Engage
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Engage. --- Asynchronous Event Trigger for Event Engage.
-- @function [parent=#AI_CAP_ZONE] __Engage -- @function [parent=#AI_CAP_ZONE] __Engage
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -188,7 +183,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string To The To State string. -- @param #string To The To State string.
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE. self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Fired. --- OnBefore Transition Handler for Event Fired.
-- @function [parent=#AI_CAP_ZONE] OnBeforeFired -- @function [parent=#AI_CAP_ZONE] OnBeforeFired
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -197,7 +192,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Fired. --- OnAfter Transition Handler for Event Fired.
-- @function [parent=#AI_CAP_ZONE] OnAfterFired -- @function [parent=#AI_CAP_ZONE] OnAfterFired
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -205,11 +200,11 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Fired. --- Synchronous Event Trigger for Event Fired.
-- @function [parent=#AI_CAP_ZONE] Fired -- @function [parent=#AI_CAP_ZONE] Fired
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Fired. --- Asynchronous Event Trigger for Event Fired.
-- @function [parent=#AI_CAP_ZONE] __Fired -- @function [parent=#AI_CAP_ZONE] __Fired
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -225,7 +220,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Destroy. --- OnAfter Transition Handler for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] OnAfterDestroy -- @function [parent=#AI_CAP_ZONE] OnAfterDestroy
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -233,17 +228,16 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Destroy. --- Synchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] Destroy -- @function [parent=#AI_CAP_ZONE] Destroy
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Destroy. --- Asynchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] __Destroy -- @function [parent=#AI_CAP_ZONE] __Destroy
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds. -- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE. self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Abort. --- OnBefore Transition Handler for Event Abort.
@@ -254,7 +248,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Abort. --- OnAfter Transition Handler for Event Abort.
-- @function [parent=#AI_CAP_ZONE] OnAfterAbort -- @function [parent=#AI_CAP_ZONE] OnAfterAbort
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -262,11 +256,11 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Abort. --- Synchronous Event Trigger for Event Abort.
-- @function [parent=#AI_CAP_ZONE] Abort -- @function [parent=#AI_CAP_ZONE] Abort
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Abort. --- Asynchronous Event Trigger for Event Abort.
-- @function [parent=#AI_CAP_ZONE] __Abort -- @function [parent=#AI_CAP_ZONE] __Abort
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -282,7 +276,7 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition. -- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Accomplish. --- OnAfter Transition Handler for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] OnAfterAccomplish -- @function [parent=#AI_CAP_ZONE] OnAfterAccomplish
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -290,11 +284,11 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Accomplish. --- Synchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] Accomplish -- @function [parent=#AI_CAP_ZONE] Accomplish
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Accomplish. --- Asynchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] __Accomplish -- @function [parent=#AI_CAP_ZONE] __Accomplish
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
@@ -303,7 +297,6 @@ function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
return self return self
end end
--- Set the Engage Zone which defines where the AI will engage bogies. --- Set the Engage Zone which defines where the AI will engage bogies.
-- @param #AI_CAP_ZONE self -- @param #AI_CAP_ZONE self
-- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAP. -- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAP.
@@ -346,7 +339,6 @@ function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
end end
--- @param AI.AI_CAP#AI_CAP_ZONE --- @param AI.AI_CAP#AI_CAP_ZONE
-- @param Wrapper.Group#GROUP EngageGroup -- @param Wrapper.Group#GROUP EngageGroup
function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm ) function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm )
@@ -358,8 +350,6 @@ function AI_CAP_ZONE.EngageRoute( EngageGroup, Fsm )
end end
end end
--- @param #AI_CAP_ZONE self --- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
@@ -380,11 +370,11 @@ end
function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To ) function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
if From ~= "Engaging" then if From ~= "Engaging" then
local Engage = false local Engage = false
for DetectedUnit, Detected in pairs( self.DetectedUnits ) do for DetectedUnit, Detected in pairs( self.DetectedUnits ) do
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
self:T( DetectedUnit ) self:T( DetectedUnit )
if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then
@@ -392,7 +382,7 @@ function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
break break
end end
end end
if Engage == true then if Engage == true then
self:F( 'Detected -> Engaging' ) self:F( 'Detected -> Engaging' )
self:__Engage( 1 ) self:__Engage( 1 )
@@ -400,7 +390,6 @@ function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
end end
end end
--- @param #AI_CAP_ZONE self --- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
@@ -411,9 +400,6 @@ function AI_CAP_ZONE:onafterAbort( Controllable, From, Event, To )
self:__Route( 1 ) self:__Route( 1 )
end end
--- @param #AI_CAP_ZONE self --- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
@@ -427,24 +413,23 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
--- Calculate the current route point. --- Calculate the current route point.
local CurrentVec2 = self.Controllable:GetVec2() local CurrentVec2 = self.Controllable:GetVec2()
if not CurrentVec2 then return self end if not CurrentVec2 then return self end
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1). --DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
local CurrentAltitude = self.Controllable:GetAltitude() local CurrentAltitude = self.Controllable:GetAltitude()
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y ) local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
local ToEngageZoneSpeed = self.PatrolMaxSpeed local ToEngageZoneSpeed = self.PatrolMaxSpeed
local CurrentRoutePoint = CurrentPointVec3:WaypointAir( local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
self.PatrolAltType, self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint,
ToEngageZoneSpeed, ToEngageZoneSpeed,
true true
) )
EngageRoute[#EngageRoute+1] = CurrentRoutePoint EngageRoute[#EngageRoute+1] = CurrentRoutePoint
--- Find a random 2D point in PatrolZone. --- Find a random 2D point in PatrolZone.
local ToTargetVec2 = self.PatrolZone:GetRandomVec2() local ToTargetVec2 = self.PatrolZone:GetRandomVec2()
self:T2( ToTargetVec2 ) self:T2( ToTargetVec2 )
@@ -453,17 +438,17 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
local ToTargetAltitude = math.random( self.EngageFloorAltitude, self.EngageCeilingAltitude ) local ToTargetAltitude = math.random( self.EngageFloorAltitude, self.EngageCeilingAltitude )
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed ) local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } ) self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } )
--- Obtain a 3D @{Point} from the 2D point + altitude. --- Obtain a 3D @{Point} from the 2D point + altitude.
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y ) local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
--- Create a route point of type air. --- Create a route point of type air.
local ToPatrolRoutePoint = ToTargetPointVec3:WaypointAir( local ToPatrolRoutePoint = ToTargetPointVec3:WaypointAir(
self.PatrolAltType, self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed, ToTargetSpeed,
true true
) )
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
@@ -482,7 +467,7 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
self:F( {"Within Zone and Engaging ", DetectedUnit } ) self:F( {"Within Zone and Engaging ", DetectedUnit } )
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit ) AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
end end
else else
if self.EngageRange then if self.EngageRange then
if DetectedUnit:GetPointVec3():Get2DDistance(Controllable:GetPointVec3() ) <= self.EngageRange then if DetectedUnit:GetPointVec3():Get2DDistance(Controllable:GetPointVec3() ) <= self.EngageRange then
self:F( {"Within Range and Engaging", DetectedUnit } ) self:F( {"Within Range and Engaging", DetectedUnit } )
@@ -506,12 +491,12 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
AttackTasks[#AttackTasks+1] = Controllable:TaskFunction( "AI_CAP_ZONE.EngageRoute", self ) AttackTasks[#AttackTasks+1] = Controllable:TaskFunction( "AI_CAP_ZONE.EngageRoute", self )
EngageRoute[1].task = Controllable:TaskCombo( AttackTasks ) EngageRoute[1].task = Controllable:TaskCombo( AttackTasks )
self:SetDetectionDeactivated() self:SetDetectionDeactivated()
end end
Controllable:Route( EngageRoute, 0.5 ) Controllable:Route( EngageRoute, 0.5 )
end end
end end
+4 -4
View File
@@ -34,10 +34,10 @@
--- AI_CAS_ZONE class --- AI_CAS_ZONE class
-- @type AI_CAS_ZONE -- @type AI_CAS_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling. -- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed. -- @field Core.Zone#ZONE_BASE TargetZone The @{Core.Zone} where the patrol needs to be executed.
-- @extends AI.AI_Patrol#AI_PATROL_ZONE -- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- Implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}. --- Implements the core functions to provide Close Air Support in an Engage @{Core.Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}.
-- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone. -- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
-- --
-- ![HoldAndEngage](..\Presentations\AI_CAS\Dia3.JPG) -- ![HoldAndEngage](..\Presentations\AI_CAS\Dia3.JPG)
@@ -130,7 +130,7 @@ AI_CAS_ZONE = {
--- Creates a new AI_CAS_ZONE object --- Creates a new AI_CAS_ZONE object
-- @param #AI_CAS_ZONE self -- @param #AI_CAS_ZONE self
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h.
@@ -496,7 +496,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To,
AttackTasks[#AttackTasks+1] = Controllable:TaskFunction( "AI_CAS_ZONE.EngageRoute", self ) AttackTasks[#AttackTasks+1] = Controllable:TaskFunction( "AI_CAS_ZONE.EngageRoute", self )
EngageRoute[#EngageRoute].task = Controllable:TaskCombo( AttackTasks ) EngageRoute[#EngageRoute].task = Controllable:TaskCombo( AttackTasks )
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone. --- Define a random point in the @{Core.Zone}. The AI will fly to that point within the zone.
--- Find a random 2D point in EngageZone. --- Find a random 2D point in EngageZone.
local ToTargetVec2 = self.EngageZone:GetRandomVec2() local ToTargetVec2 = self.EngageZone:GetRandomVec2()
+1 -1
View File
@@ -41,7 +41,7 @@
--- Build large formations, make AI follow a @{Wrapper.Client#CLIENT} (player) leader or a @{Wrapper.Unit#UNIT} (AI) leader. --- Build large formations, make AI follow a @{Wrapper.Client#CLIENT} (player) leader or a @{Wrapper.Unit#UNIT} (AI) leader.
-- --
-- AI_FORMATION makes AI @{GROUP}s fly in formation of various compositions. -- AI_FORMATION makes AI @{Wrapper.Group#GROUP}s fly in formation of various compositions.
-- The AI_FORMATION class models formations in a different manner than the internal DCS formation logic!!! -- The AI_FORMATION class models formations in a different manner than the internal DCS formation logic!!!
-- The purpose of the class is to: -- The purpose of the class is to:
-- --
+38 -38
View File
@@ -38,7 +38,7 @@
--- AI_PATROL_ZONE class --- AI_PATROL_ZONE class
-- @type AI_PATROL_ZONE -- @type AI_PATROL_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling. -- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Wrapper.Controllable} patrolling.
-- @field Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @field Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @field DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @field DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @field DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @field DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @field DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h. -- @field DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h.
@@ -46,7 +46,7 @@
-- @field Core.Spawn#SPAWN CoordTest -- @field Core.Spawn#SPAWN CoordTest
-- @extends Core.Fsm#FSM_CONTROLLABLE -- @extends Core.Fsm#FSM_CONTROLLABLE
--- Implements the core functions to patrol a @{Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}. --- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}.
-- --
-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG) -- ![Process](..\Presentations\AI_PATROL\Dia3.JPG)
-- --
@@ -135,15 +135,15 @@
-- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base. -- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated. -- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated.
-- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, -- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit,
-- while a new AI is targetted to the AI_PATROL_ZONE. -- while a new AI is targeted to the AI_PATROL_ZONE.
-- Once the time is finished, the old AI will return to the base. -- Once the time is finished, the old AI will return to the base.
-- Use the method @{#AI_PATROL_ZONE.ManageFuel}() to have this proces in place. -- Use the method @{#AI_PATROL_ZONE.ManageFuel}() to have this process in place.
-- --
-- ## 7. Manage "damage" behaviour of the AI in the AI_PATROL_ZONE -- ## 7. Manage "damage" behaviour of the AI in the AI_PATROL_ZONE
-- --
-- When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on. -- When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on.
-- Therefore, when the damage threshold is reached, the AI will return immediately to the home base (RTB). -- Therefore, when the damage threshold is reached, the AI will return immediately to the home base (RTB).
-- Use the method @{#AI_PATROL_ZONE.ManageDamage}() to have this proces in place. -- Use the method @{#AI_PATROL_ZONE.ManageDamage}() to have this process in place.
-- --
-- === -- ===
-- --
@@ -154,7 +154,7 @@ AI_PATROL_ZONE = {
--- Creates a new AI_PATROL_ZONE object --- Creates a new AI_PATROL_ZONE object
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed. -- @param Core.Zone#ZONE_BASE PatrolZone The @{Core.Zone} where the patrol needs to be executed.
-- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol. -- @param DCS#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h. -- @param DCS#Speed PatrolMinSpeed The minimum speed of the @{Wrapper.Controllable} in km/h.
@@ -170,27 +170,27 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New() ) -- #AI_PATROL_ZONE local self = BASE:Inherit( self, FSM_CONTROLLABLE:New() ) -- #AI_PATROL_ZONE
self.PatrolZone = PatrolZone self.PatrolZone = PatrolZone
self.PatrolFloorAltitude = PatrolFloorAltitude self.PatrolFloorAltitude = PatrolFloorAltitude
self.PatrolCeilingAltitude = PatrolCeilingAltitude self.PatrolCeilingAltitude = PatrolCeilingAltitude
self.PatrolMinSpeed = PatrolMinSpeed self.PatrolMinSpeed = PatrolMinSpeed
self.PatrolMaxSpeed = PatrolMaxSpeed self.PatrolMaxSpeed = PatrolMaxSpeed
-- defafult PatrolAltType to "BARO" if not specified -- defafult PatrolAltType to "BARO" if not specified
self.PatrolAltType = PatrolAltType or "BARO" self.PatrolAltType = PatrolAltType or "BARO"
self:SetRefreshTimeInterval( 30 ) self:SetRefreshTimeInterval( 30 )
self.CheckStatus = true self.CheckStatus = true
self:ManageFuel( .2, 60 ) self:ManageFuel( .2, 60 )
self:ManageDamage( 1 ) self:ManageDamage( 1 )
self.DetectedUnits = {} -- This table contains the targets detected during patrol. self.DetectedUnits = {} -- This table contains the targets detected during patrol.
self:SetStartState( "None" ) self:SetStartState( "None" )
self:AddTransition( "*", "Stop", "Stopped" ) self:AddTransition( "*", "Stop", "Stopped" )
@@ -228,7 +228,7 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Stop. --- Synchronous Event Trigger for Event Stop.
-- @function [parent=#AI_PATROL_ZONE] Stop -- @function [parent=#AI_PATROL_ZONE] Stop
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
@@ -256,7 +256,7 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Start. --- Synchronous Event Trigger for Event Start.
-- @function [parent=#AI_PATROL_ZONE] Start -- @function [parent=#AI_PATROL_ZONE] Start
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
@@ -329,7 +329,7 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event Status. --- Synchronous Event Trigger for Event Status.
-- @function [parent=#AI_PATROL_ZONE] Status -- @function [parent=#AI_PATROL_ZONE] Status
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
@@ -413,7 +413,7 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
--- Synchronous Event Trigger for Event RTB. --- Synchronous Event Trigger for Event RTB.
-- @function [parent=#AI_PATROL_ZONE] RTB -- @function [parent=#AI_PATROL_ZONE] RTB
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
@@ -441,11 +441,11 @@ function AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltit
-- @param #string To The To State string. -- @param #string To The To State string.
self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_PATROL_ZONE. self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_PATROL_ZONE.
self:AddTransition( "*", "Eject", "*" ) self:AddTransition( "*", "Eject", "*" )
self:AddTransition( "*", "Crash", "Crashed" ) self:AddTransition( "*", "Crash", "Crashed" )
self:AddTransition( "*", "PilotDead", "*" ) self:AddTransition( "*", "PilotDead", "*" )
return self return self
end end
@@ -459,7 +459,7 @@ end
-- @return #AI_PATROL_ZONE self -- @return #AI_PATROL_ZONE self
function AI_PATROL_ZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed ) function AI_PATROL_ZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } ) self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
self.PatrolMinSpeed = PatrolMinSpeed self.PatrolMinSpeed = PatrolMinSpeed
self.PatrolMaxSpeed = PatrolMaxSpeed self.PatrolMaxSpeed = PatrolMaxSpeed
end end
@@ -473,7 +473,7 @@ end
-- @return #AI_PATROL_ZONE self -- @return #AI_PATROL_ZONE self
function AI_PATROL_ZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude ) function AI_PATROL_ZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } ) self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
self.PatrolFloorAltitude = PatrolFloorAltitude self.PatrolFloorAltitude = PatrolFloorAltitude
self.PatrolCeilingAltitude = PatrolCeilingAltitude self.PatrolCeilingAltitude = PatrolCeilingAltitude
end end
@@ -582,7 +582,7 @@ end
--- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base. --- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated. -- Therefore, with a parameter and a calculation of the distance to the home base, the fuel threshold is calculated.
-- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the AI_PATROL_ZONE. -- When the fuel threshold is reached, the AI will continue for a given time its patrol task in orbit, while a new AIControllable is targeted to the AI_PATROL_ZONE.
-- Once the time is finished, the old AI will return to the base. -- Once the time is finished, the old AI will return to the base.
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
-- @param #number PatrolFuelThresholdPercentage The threshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel. -- @param #number PatrolFuelThresholdPercentage The threshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.
@@ -592,7 +592,7 @@ function AI_PATROL_ZONE:ManageFuel( PatrolFuelThresholdPercentage, PatrolOutOfFu
self.PatrolFuelThresholdPercentage = PatrolFuelThresholdPercentage self.PatrolFuelThresholdPercentage = PatrolFuelThresholdPercentage
self.PatrolOutOfFuelOrbitTime = PatrolOutOfFuelOrbitTime self.PatrolOutOfFuelOrbitTime = PatrolOutOfFuelOrbitTime
return self return self
end end
@@ -609,28 +609,28 @@ function AI_PATROL_ZONE:ManageDamage( PatrolDamageThreshold )
self.PatrolManageDamage = true self.PatrolManageDamage = true
self.PatrolDamageThreshold = PatrolDamageThreshold self.PatrolDamageThreshold = PatrolDamageThreshold
return self return self
end end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
-- @return #AI_PATROL_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
-- @return #AI_PATROL_ZONE self
function AI_PATROL_ZONE:onafterStart( Controllable, From, Event, To ) function AI_PATROL_ZONE:onafterStart( Controllable, From, Event, To )
self:F2() self:F2()
self:__Route( 1 ) -- Route to the patrol point. The asynchronous trigger is important, because a spawned group and units takes at least one second to come live. self:__Route( 1 ) -- Route to the patrol point. The asynchronous trigger is important, because a spawned group and units takes at least one second to come live.
self:__Status( 60 ) -- Check status status every 30 seconds. self:__Status( 60 ) -- Check status status every 30 seconds.
self:SetDetectionActivated() self:SetDetectionActivated()
self:HandleEvent( EVENTS.PilotDead, self.OnPilotDead ) self:HandleEvent( EVENTS.PilotDead, self.OnPilotDead )
self:HandleEvent( EVENTS.Crash, self.OnCrash ) self:HandleEvent( EVENTS.Crash, self.OnCrash )
self:HandleEvent( EVENTS.Ejection, self.OnEjection ) self:HandleEvent( EVENTS.Ejection, self.OnEjection )
Controllable:OptionROEHoldFire() Controllable:OptionROEHoldFire()
Controllable:OptionROTVertical() Controllable:OptionROTVertical()
@@ -667,12 +667,12 @@ function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
if TargetObject and TargetObject:isExist() and TargetObject.id_ < 50000000 then if TargetObject and TargetObject:isExist() and TargetObject.id_ < 50000000 then
local TargetUnit = UNIT:Find( TargetObject ) local TargetUnit = UNIT:Find( TargetObject )
-- Check that target is alive due to issue https://github.com/FlightControl-Master/MOOSE/issues/1234 -- Check that target is alive due to issue https://github.com/FlightControl-Master/MOOSE/issues/1234
if TargetUnit and TargetUnit:IsAlive() then if TargetUnit and TargetUnit:IsAlive() then
local TargetUnitName = TargetUnit:GetName() local TargetUnitName = TargetUnit:GetName()
if self.DetectionZone then if self.DetectionZone then
if TargetUnit:IsInZone( self.DetectionZone ) then if TargetUnit:IsInZone( self.DetectionZone ) then
self:T( {"Detected ", TargetUnit } ) self:T( {"Detected ", TargetUnit } )
@@ -687,13 +687,13 @@ function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
end end
Detected = true Detected = true
end end
end end
end end
end end
self:__Detect( -self.DetectInterval ) self:__Detect( -self.DetectInterval )
if Detected == true then if Detected == true then
self:__Detected( 1.5 ) self:__Detected( 1.5 )
end end
@@ -701,7 +701,7 @@ function AI_PATROL_ZONE:onafterDetect( Controllable, From, Event, To )
end end
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable --- @param Wrapper.Controllable#CONTROLLABLE AIControllable
-- This statis method is called from the route path within the last task at the last waaypoint of the Controllable. -- This static method is called from the route path within the last task at the last waypoint of the Controllable.
-- Note that this method is required, as triggers the next route when patrolling for the Controllable. -- Note that this method is required, as triggers the next route when patrolling for the Controllable.
function AI_PATROL_ZONE:_NewPatrolRoute( AIControllable ) function AI_PATROL_ZONE:_NewPatrolRoute( AIControllable )
@@ -710,7 +710,7 @@ function AI_PATROL_ZONE:_NewPatrolRoute( AIControllable )
end end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings. --- Defines a new patrol route using the @{#AI_PATROL_ZONE} parameters and settings.
-- @param #AI_PATROL_ZONE self -- @param #AI_PATROL_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string. -- @param #string From The From State string.
@@ -729,7 +729,7 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
if self.Controllable:IsAlive() and life > 1 then if self.Controllable:IsAlive() and life > 1 then
-- Determine if the AIControllable is within the PatrolZone. -- Determine if the AIControllable is within the PatrolZone.
-- If not, make a waypoint within the to that the AIControllable will fly at maximum speed to that point. -- If not, make a waypoint within the to that the AIControllable will fly at maximum speed to that point.
local PatrolRoute = {} local PatrolRoute = {}
-- Calculate the current route point of the controllable as the start point of the route. -- Calculate the current route point of the controllable as the start point of the route.
@@ -775,7 +775,7 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
end end
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone. --- Define a random point in the @{Core.Zone}. The AI will fly to that point within the zone.
--- Find a random 2D point in PatrolZone. --- Find a random 2D point in PatrolZone.
local ToTargetVec2 = self.PatrolZone:GetRandomVec2() local ToTargetVec2 = self.PatrolZone:GetRandomVec2()
@@ -1,4 +1,4 @@
--- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occuring on @{Wrapper.Unit}s. --- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occurring on @{Wrapper.Unit}s.
-- --
-- ![Banner Image](..\Presentations\ACT_ACCOUNT\Dia1.JPG) -- ![Banner Image](..\Presentations\ACT_ACCOUNT\Dia1.JPG)
-- --
@@ -20,7 +20,7 @@ do -- ACT_ACCOUNT
-- --
-- ### ACT_ACCOUNT States -- ### ACT_ACCOUNT States
-- --
-- * **Asigned**: The player is assigned. -- * **Assigned**: The player is assigned.
-- * **Waiting**: Waiting for an event. -- * **Waiting**: Waiting for an event.
-- * **Report**: Reporting. -- * **Report**: Reporting.
-- * **Account**: Account for an event. -- * **Account**: Account for an event.
@@ -104,7 +104,6 @@ do -- ACT_ACCOUNT
self:__Wait( 1 ) self:__Wait( 1 )
end end
--- StateMachine callback function --- StateMachine callback function
-- @param #ACT_ACCOUNT self -- @param #ACT_ACCOUNT self
-- @param Wrapper.Unit#UNIT ProcessUnit -- @param Wrapper.Unit#UNIT ProcessUnit
@@ -141,7 +140,7 @@ do -- ACT_ACCOUNT_DEADS
--- # @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Core.Fsm.Account#ACT_ACCOUNT} --- # @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Core.Fsm.Account#ACT_ACCOUNT}
-- --
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units. -- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
-- The process is given a @{Set} of units that will be tracked upon successful destruction. -- The process is given a @{Core.Set} of units that will be tracked upon successful destruction.
-- The process will end after each target has been successfully destroyed. -- The process will end after each target has been successfully destroyed.
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered. -- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
-- --
@@ -157,7 +156,6 @@ do -- ACT_ACCOUNT_DEADS
ClassName = "ACT_ACCOUNT_DEADS", ClassName = "ACT_ACCOUNT_DEADS",
} }
--- Creates a new DESTROY process. --- Creates a new DESTROY process.
-- @param #ACT_ACCOUNT_DEADS self -- @param #ACT_ACCOUNT_DEADS self
-- @param Core.Set#SET_UNIT TargetSetUnit -- @param Core.Set#SET_UNIT TargetSetUnit
@@ -195,7 +193,6 @@ do -- ACT_ACCOUNT_DEADS
self:GetCommandCenter():MessageTypeToGroup( MessageText, ProcessUnit:GetGroup(), MESSAGE.Type.Information ) self:GetCommandCenter():MessageTypeToGroup( MessageText, ProcessUnit:GetGroup(), MESSAGE.Type.Information )
end end
--- StateMachine callback function --- StateMachine callback function
-- @param #ACT_ACCOUNT_DEADS self -- @param #ACT_ACCOUNT_DEADS self
-- @param Wrapper.Unit#UNIT ProcessUnit -- @param Wrapper.Unit#UNIT ProcessUnit
@@ -270,7 +267,6 @@ do -- ACT_ACCOUNT_DEADS
end end
end end
--- DCS Events --- DCS Events
--- @param #ACT_ACCOUNT_DEADS self --- @param #ACT_ACCOUNT_DEADS self
@@ -50,7 +50,7 @@
-- --
-- # 1) @{#ACT_ASSIST_SMOKE_TARGETS_ZONE} class, extends @{Core.Fsm.Route#ACT_ASSIST} -- # 1) @{#ACT_ASSIST_SMOKE_TARGETS_ZONE} class, extends @{Core.Fsm.Route#ACT_ASSIST}
-- --
-- The ACT_ASSIST_SMOKE_TARGETS_ZONE class implements the core functions to smoke targets in a @{Zone}. -- The ACT_ASSIST_SMOKE_TARGETS_ZONE class implements the core functions to smoke targets in a @{Core.Zone}.
-- The targets are smoked within a certain range around each target, simulating a realistic smoking behaviour. -- The targets are smoked within a certain range around each target, simulating a realistic smoking behaviour.
-- At random intervals, a new target is smoked. -- At random intervals, a new target is smoked.
-- --
@@ -62,7 +62,7 @@
-- --
-- # 1) @{#ACT_ROUTE_ZONE} class, extends @{Core.Fsm.Route#ACT_ROUTE} -- # 1) @{#ACT_ROUTE_ZONE} class, extends @{Core.Fsm.Route#ACT_ROUTE}
-- --
-- The ACT_ROUTE_ZONE class implements the core functions to route an AIR @{Wrapper.Controllable} player @{Wrapper.Unit} to a @{Zone}. -- The ACT_ROUTE_ZONE class implements the core functions to route an AIR @{Wrapper.Controllable} player @{Wrapper.Unit} to a @{Core.Zone}.
-- The player receives on perioding times messages with the coordinates of the route to follow. -- The player receives on perioding times messages with the coordinates of the route to follow.
-- Upon arrival at the zone, a confirmation of arrival is sent, and the process will be ended. -- Upon arrival at the zone, a confirmation of arrival is sent, and the process will be ended.
-- --
+110 -147
View File
@@ -377,7 +377,7 @@ do -- CARGO
-- @field #boolean Moveable This flag defines if the cargo is moveable. -- @field #boolean Moveable This flag defines if the cargo is moveable.
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit. -- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
-- @field #boolean Containable This flag defines if the cargo can be contained within a DCS Unit. -- @field #boolean Containable This flag defines if the cargo can be contained within a DCS Unit.
--- Defines the core functions that defines a cargo object within MOOSE. --- Defines the core functions that defines a cargo object within MOOSE.
-- --
-- A cargo is a **logical object** defined that is available for transport, and has a life status within a simulation. -- A cargo is a **logical object** defined that is available for transport, and has a life status within a simulation.
@@ -430,8 +430,7 @@ do -- CARGO
--- @type CARGO.CargoObjects --- @type CARGO.CargoObjects
-- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo. -- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
--- CARGO Constructor. This class is an abstract class and should not be instantiated. --- CARGO Constructor. This class is an abstract class and should not be instantiated.
-- @param #CARGO self -- @param #CARGO self
-- @param #string Type -- @param #string Type
@@ -441,10 +440,10 @@ do -- CARGO
-- @param #number NearRadius (optional) -- @param #number NearRadius (optional)
-- @return #CARGO -- @return #CARGO
function CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) --R2.1 function CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) --R2.1
local self = BASE:Inherit( self, FSM:New() ) -- #CARGO local self = BASE:Inherit( self, FSM:New() ) -- #CARGO
self:F( { Type, Name, Weight, LoadRadius, NearRadius } ) self:F( { Type, Name, Weight, LoadRadius, NearRadius } )
self:SetStartState( "UnLoaded" ) self:SetStartState( "UnLoaded" )
self:AddTransition( { "UnLoaded", "Boarding" }, "Board", "Boarding" ) self:AddTransition( { "UnLoaded", "Boarding" }, "Board", "Boarding" )
self:AddTransition( "Boarding" , "Boarding", "Boarding" ) self:AddTransition( "Boarding" , "Boarding", "Boarding" )
@@ -459,7 +458,7 @@ do -- CARGO
self:AddTransition( "*", "Destroyed", "Destroyed" ) self:AddTransition( "*", "Destroyed", "Destroyed" )
self:AddTransition( "*", "Respawn", "UnLoaded" ) self:AddTransition( "*", "Respawn", "UnLoaded" )
self:AddTransition( "*", "Reset", "UnLoaded" ) self:AddTransition( "*", "Reset", "UnLoaded" )
self.Type = Type self.Type = Type
self.Name = Name self.Name = Name
self.Weight = Weight or 0 self.Weight = Weight or 0
@@ -471,31 +470,29 @@ do -- CARGO
self.Containable = false self.Containable = false
self.CargoLimit = 0 self.CargoLimit = 0
self.LoadRadius = LoadRadius or 500 self.LoadRadius = LoadRadius or 500
--self.NearRadius = NearRadius or 25 --self.NearRadius = NearRadius or 25
self:SetDeployed( false ) self:SetDeployed( false )
self.CargoScheduler = SCHEDULER:New() self.CargoScheduler = SCHEDULER:New()
CARGOS[self.Name] = self CARGOS[self.Name] = self
return self return self
end end
--- Find a CARGO in the _DATABASE. --- Find a CARGO in the _DATABASE.
-- @param #CARGO self -- @param #CARGO self
-- @param #string CargoName The Cargo Name. -- @param #string CargoName The Cargo Name.
-- @return #CARGO self -- @return #CARGO self
function CARGO:FindByName( CargoName ) function CARGO:FindByName( CargoName )
local CargoFound = _DATABASE:FindCargo( CargoName ) local CargoFound = _DATABASE:FindCargo( CargoName )
return CargoFound return CargoFound
end end
--- Get the x position of the cargo. --- Get the x position of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number -- @return #number
@@ -504,9 +501,9 @@ do -- CARGO
return self.CargoCarrier:GetCoordinate().x return self.CargoCarrier:GetCoordinate().x
else else
return self.CargoObject:GetCoordinate().x return self.CargoObject:GetCoordinate().x
end end
end end
--- Get the y position of the cargo. --- Get the y position of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number -- @return #number
@@ -515,9 +512,9 @@ do -- CARGO
return self.CargoCarrier:GetCoordinate().z return self.CargoCarrier:GetCoordinate().z
else else
return self.CargoObject:GetCoordinate().z return self.CargoObject:GetCoordinate().z
end end
end end
--- Get the heading of the cargo. --- Get the heading of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number -- @return #number
@@ -526,22 +523,21 @@ do -- CARGO
return self.CargoCarrier:GetHeading() return self.CargoCarrier:GetHeading()
else else
return self.CargoObject:GetHeading() return self.CargoObject:GetHeading()
end end
end end
--- Check if the cargo can be Slingloaded. --- Check if the cargo can be Slingloaded.
-- @param #CARGO self -- @param #CARGO self
function CARGO:CanSlingload() function CARGO:CanSlingload()
return false return false
end end
--- Check if the cargo can be Boarded. --- Check if the cargo can be Boarded.
-- @param #CARGO self -- @param #CARGO self
function CARGO:CanBoard() function CARGO:CanBoard()
return true return true
end end
--- Check if the cargo can be Unboarded. --- Check if the cargo can be Unboarded.
-- @param #CARGO self -- @param #CARGO self
function CARGO:CanUnboard() function CARGO:CanUnboard()
@@ -553,14 +549,13 @@ do -- CARGO
function CARGO:CanLoad() function CARGO:CanLoad()
return true return true
end end
--- Check if the cargo can be Unloaded. --- Check if the cargo can be Unloaded.
-- @param #CARGO self -- @param #CARGO self
function CARGO:CanUnload() function CARGO:CanUnload()
return true return true
end end
--- Destroy the cargo. --- Destroy the cargo.
-- @param #CARGO self -- @param #CARGO self
function CARGO:Destroy() function CARGO:Destroy()
@@ -569,14 +564,14 @@ do -- CARGO
end end
self:Destroyed() self:Destroyed()
end end
--- Get the name of the Cargo. --- Get the name of the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #string The name of the Cargo. -- @return #string The name of the Cargo.
function CARGO:GetName() --R2.1 function CARGO:GetName() --R2.1
return self.Name return self.Name
end end
--- Get the current active object representing or being the Cargo. --- Get the current active object representing or being the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return Wrapper.Positionable#POSITIONABLE The object representing or being the Cargo. -- @return Wrapper.Positionable#POSITIONABLE The object representing or being the Cargo.
@@ -585,9 +580,9 @@ do -- CARGO
return self.CargoCarrier return self.CargoCarrier
else else
return self.CargoObject return self.CargoObject
end end
end end
--- Get the object name of the Cargo. --- Get the object name of the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #string The object name of the Cargo. -- @return #string The object name of the Cargo.
@@ -596,9 +591,9 @@ do -- CARGO
return self.CargoCarrier:GetName() return self.CargoCarrier:GetName()
else else
return self.CargoObject:GetName() return self.CargoObject:GetName()
end end
end end
--- Get the amount of Cargo. --- Get the amount of Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number The amount of Cargo. -- @return #number The amount of Cargo.
@@ -613,7 +608,6 @@ do -- CARGO
return self.Type return self.Type
end end
--- Get the transportation method of the Cargo. --- Get the transportation method of the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #string The transportation method of the Cargo. -- @return #string The transportation method of the Cargo.
@@ -621,7 +615,6 @@ do -- CARGO
return self.TransportationMethod return self.TransportationMethod
end end
--- Get the coalition of the Cargo. --- Get the coalition of the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return Coalition -- @return Coalition
@@ -630,32 +623,30 @@ do -- CARGO
return self.CargoCarrier:GetCoalition() return self.CargoCarrier:GetCoalition()
else else
return self.CargoObject:GetCoalition() return self.CargoObject:GetCoalition()
end end
end end
--- Get the current coordinates of the Cargo. --- Get the current coordinates of the Cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return Core.Point#COORDINATE The coordinates of the Cargo. -- @return Core.Point#COORDINATE The coordinates of the Cargo.
function CARGO:GetCoordinate() function CARGO:GetCoordinate()
return self.CargoObject:GetCoordinate() return self.CargoObject:GetCoordinate()
end end
--- Check if cargo is destroyed. --- Check if cargo is destroyed.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if destroyed -- @return #boolean true if destroyed
function CARGO:IsDestroyed() function CARGO:IsDestroyed()
return self:Is( "Destroyed" ) return self:Is( "Destroyed" )
end end
--- Check if cargo is loaded. --- Check if cargo is loaded.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if loaded -- @return #boolean true if loaded
function CARGO:IsLoaded() function CARGO:IsLoaded()
return self:Is( "Loaded" ) return self:Is( "Loaded" )
end end
--- Check if cargo is loaded. --- Check if cargo is loaded.
-- @param #CARGO self -- @param #CARGO self
-- @param Wrapper.Unit#UNIT Carrier -- @param Wrapper.Unit#UNIT Carrier
@@ -663,14 +654,14 @@ do -- CARGO
function CARGO:IsLoadedInCarrier( Carrier ) function CARGO:IsLoadedInCarrier( Carrier )
return self.CargoCarrier and self.CargoCarrier:GetName() == Carrier:GetName() return self.CargoCarrier and self.CargoCarrier:GetName() == Carrier:GetName()
end end
--- Check if cargo is unloaded. --- Check if cargo is unloaded.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if unloaded -- @return #boolean true if unloaded
function CARGO:IsUnLoaded() function CARGO:IsUnLoaded()
return self:Is( "UnLoaded" ) return self:Is( "UnLoaded" )
end end
--- Check if cargo is boarding. --- Check if cargo is boarding.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if boarding -- @return #boolean true if boarding
@@ -678,52 +669,47 @@ do -- CARGO
return self:Is( "Boarding" ) return self:Is( "Boarding" )
end end
--- Check if cargo is unboarding. --- Check if cargo is unboarding.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if unboarding -- @return #boolean true if unboarding
function CARGO:IsUnboarding() function CARGO:IsUnboarding()
return self:Is( "UnBoarding" ) return self:Is( "UnBoarding" )
end end
--- Check if cargo is alive. --- Check if cargo is alive.
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean true if unloaded -- @return #boolean true if unloaded
function CARGO:IsAlive() function CARGO:IsAlive()
if self:IsLoaded() then if self:IsLoaded() then
return self.CargoCarrier:IsAlive() return self.CargoCarrier:IsAlive()
else else
return self.CargoObject:IsAlive() return self.CargoObject:IsAlive()
end end
end end
--- Set the cargo as deployed. --- Set the cargo as deployed.
-- @param #CARGO self -- @param #CARGO self
-- @param #boolean Deployed true if the cargo is to be deployed. false or nil otherwise. -- @param #boolean Deployed true if the cargo is to be deployed. false or nil otherwise.
function CARGO:SetDeployed( Deployed ) function CARGO:SetDeployed( Deployed )
self.Deployed = Deployed self.Deployed = Deployed
end end
--- Is the cargo deployed --- Is the cargo deployed
-- @param #CARGO self -- @param #CARGO self
-- @return #boolean -- @return #boolean
function CARGO:IsDeployed() function CARGO:IsDeployed()
return self.Deployed return self.Deployed
end end
--- Template method to spawn a new representation of the CARGO in the simulator. --- Template method to spawn a new representation of the CARGO in the simulator.
-- @param #CARGO self -- @param #CARGO self
-- @return #CARGO -- @return #CARGO
function CARGO:Spawn( PointVec2 ) function CARGO:Spawn( PointVec2 )
self:F() self:F()
end end
--- Signal a flare at the position of the CARGO. --- Signal a flare at the position of the CARGO.
-- @param #CARGO self -- @param #CARGO self
-- @param Utilities.Utils#FLARECOLOR FlareColor -- @param Utilities.Utils#FLARECOLOR FlareColor
@@ -732,31 +718,31 @@ do -- CARGO
trigger.action.signalFlare( self.CargoObject:GetVec3(), FlareColor , 0 ) trigger.action.signalFlare( self.CargoObject:GetVec3(), FlareColor , 0 )
end end
end end
--- Signal a white flare at the position of the CARGO. --- Signal a white flare at the position of the CARGO.
-- @param #CARGO self -- @param #CARGO self
function CARGO:FlareWhite() function CARGO:FlareWhite()
self:Flare( trigger.flareColor.White ) self:Flare( trigger.flareColor.White )
end end
--- Signal a yellow flare at the position of the CARGO. --- Signal a yellow flare at the position of the CARGO.
-- @param #CARGO self -- @param #CARGO self
function CARGO:FlareYellow() function CARGO:FlareYellow()
self:Flare( trigger.flareColor.Yellow ) self:Flare( trigger.flareColor.Yellow )
end end
--- Signal a green flare at the position of the CARGO. --- Signal a green flare at the position of the CARGO.
-- @param #CARGO self -- @param #CARGO self
function CARGO:FlareGreen() function CARGO:FlareGreen()
self:Flare( trigger.flareColor.Green ) self:Flare( trigger.flareColor.Green )
end end
--- Signal a red flare at the position of the CARGO. --- Signal a red flare at the position of the CARGO.
-- @param #CARGO self -- @param #CARGO self
function CARGO:FlareRed() function CARGO:FlareRed()
self:Flare( trigger.flareColor.Red ) self:Flare( trigger.flareColor.Red )
end end
--- Smoke the CARGO. --- Smoke the CARGO.
-- @param #CARGO self -- @param #CARGO self
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The color of the smoke. -- @param Utilities.Utils#SMOKECOLOR SmokeColor The color of the smoke.
@@ -770,38 +756,37 @@ do -- CARGO
end end
end end
end end
--- Smoke the CARGO Green. --- Smoke the CARGO Green.
-- @param #CARGO self -- @param #CARGO self
function CARGO:SmokeGreen() function CARGO:SmokeGreen()
self:Smoke( trigger.smokeColor.Green, Range ) self:Smoke( trigger.smokeColor.Green, Range )
end end
--- Smoke the CARGO Red. --- Smoke the CARGO Red.
-- @param #CARGO self -- @param #CARGO self
function CARGO:SmokeRed() function CARGO:SmokeRed()
self:Smoke( trigger.smokeColor.Red, Range ) self:Smoke( trigger.smokeColor.Red, Range )
end end
--- Smoke the CARGO White. --- Smoke the CARGO White.
-- @param #CARGO self -- @param #CARGO self
function CARGO:SmokeWhite() function CARGO:SmokeWhite()
self:Smoke( trigger.smokeColor.White, Range ) self:Smoke( trigger.smokeColor.White, Range )
end end
--- Smoke the CARGO Orange. --- Smoke the CARGO Orange.
-- @param #CARGO self -- @param #CARGO self
function CARGO:SmokeOrange() function CARGO:SmokeOrange()
self:Smoke( trigger.smokeColor.Orange, Range ) self:Smoke( trigger.smokeColor.Orange, Range )
end end
--- Smoke the CARGO Blue. --- Smoke the CARGO Blue.
-- @param #CARGO self -- @param #CARGO self
function CARGO:SmokeBlue() function CARGO:SmokeBlue()
self:Smoke( trigger.smokeColor.Blue, Range ) self:Smoke( trigger.smokeColor.Blue, Range )
end end
--- Set the Load radius, which is the radius till when the Cargo can be loaded. --- Set the Load radius, which is the radius till when the Cargo can be loaded.
-- @param #CARGO self -- @param #CARGO self
-- @param #number LoadRadius The radius till Cargo can be loaded. -- @param #number LoadRadius The radius till Cargo can be loaded.
@@ -809,23 +794,21 @@ do -- CARGO
function CARGO:SetLoadRadius( LoadRadius ) function CARGO:SetLoadRadius( LoadRadius )
self.LoadRadius = LoadRadius or 150 self.LoadRadius = LoadRadius or 150
end end
--- Get the Load radius, which is the radius till when the Cargo can be loaded. --- Get the Load radius, which is the radius till when the Cargo can be loaded.
-- @param #CARGO self -- @param #CARGO self
-- @return #number The radius till Cargo can be loaded. -- @return #number The radius till Cargo can be loaded.
function CARGO:GetLoadRadius() function CARGO:GetLoadRadius()
return self.LoadRadius return self.LoadRadius
end end
--- Check if Cargo is in the LoadRadius for the Cargo to be Boarded or Loaded. --- Check if Cargo is in the LoadRadius for the Cargo to be Boarded or Loaded.
-- @param #CARGO self -- @param #CARGO self
-- @param Core.Point#COORDINATE Coordinate -- @param Core.Point#COORDINATE Coordinate
-- @return #boolean true if the CargoGroup is within the loading radius. -- @return #boolean true if the CargoGroup is within the loading radius.
function CARGO:IsInLoadRadius( Coordinate ) function CARGO:IsInLoadRadius( Coordinate )
self:F( { Coordinate, LoadRadius = self.LoadRadius } ) self:F( { Coordinate, LoadRadius = self.LoadRadius } )
local Distance = 0 local Distance = 0
if self:IsUnLoaded() then if self:IsUnLoaded() then
local CargoCoordinate = self.CargoObject:GetCoordinate() local CargoCoordinate = self.CargoObject:GetCoordinate()
@@ -835,18 +818,17 @@ do -- CARGO
return true return true
end end
end end
return false return false
end end
--- Check if the Cargo can report itself to be Boarded or Loaded. --- Check if the Cargo can report itself to be Boarded or Loaded.
-- @param #CARGO self -- @param #CARGO self
-- @param Core.Point#COORDINATE Coordinate -- @param Core.Point#COORDINATE Coordinate
-- @return #boolean true if the Cargo can report itself. -- @return #boolean true if the Cargo can report itself.
function CARGO:IsInReportRadius( Coordinate ) function CARGO:IsInReportRadius( Coordinate )
self:F( { Coordinate } ) self:F( { Coordinate } )
local Distance = 0 local Distance = 0
if self:IsUnLoaded() then if self:IsUnLoaded() then
Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() ) Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
@@ -855,7 +837,7 @@ do -- CARGO
return true return true
end end
end end
return false return false
end end
@@ -867,7 +849,7 @@ do -- CARGO
-- @return #boolean -- @return #boolean
function CARGO:IsNear( Coordinate, NearRadius ) function CARGO:IsNear( Coordinate, NearRadius )
--self:F( { PointVec2 = PointVec2, NearRadius = NearRadius } ) --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius } )
if self.CargoObject:IsAlive() then if self.CargoObject:IsAlive() then
--local Distance = PointVec2:Get2DDistance( self.CargoObject:GetPointVec2() ) --local Distance = PointVec2:Get2DDistance( self.CargoObject:GetPointVec2() )
--self:F( { CargoObjectName = self.CargoObject:GetName() } ) --self:F( { CargoObjectName = self.CargoObject:GetName() } )
@@ -875,26 +857,24 @@ do -- CARGO
--self:F( { PointVec2 = PointVec2:GetVec2() } ) --self:F( { PointVec2 = PointVec2:GetVec2() } )
local Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() ) local Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() )
--self:F( { Distance = Distance, NearRadius = NearRadius or "nil" } ) --self:F( { Distance = Distance, NearRadius = NearRadius or "nil" } )
if Distance <= NearRadius then if Distance <= NearRadius then
--self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } ) --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } )
return true return true
end end
end end
--self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } ) --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } )
return false return false
end end
--- Check if Cargo is the given @{Core.Zone}.
--- Check if Cargo is the given @{Zone}.
-- @param #CARGO self -- @param #CARGO self
-- @param Core.Zone#ZONE_BASE Zone -- @param Core.Zone#ZONE_BASE Zone
-- @return #boolean **true** if cargo is in the Zone, **false** if cargo is not in the Zone. -- @return #boolean **true** if cargo is in the Zone, **false** if cargo is not in the Zone.
function CARGO:IsInZone( Zone ) function CARGO:IsInZone( Zone )
--self:F( { Zone } ) --self:F( { Zone } )
if self:IsLoaded() then if self:IsLoaded() then
return Zone:IsPointVec2InZone( self.CargoCarrier:GetPointVec2() ) return Zone:IsPointVec2InZone( self.CargoCarrier:GetPointVec2() )
else else
@@ -904,34 +884,33 @@ do -- CARGO
else else
return false return false
end end
end end
return nil return nil
end end
--- Get the current PointVec2 of the cargo. --- Get the current PointVec2 of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return Core.Point#POINT_VEC2 -- @return Core.Point#POINT_VEC2
function CARGO:GetPointVec2() function CARGO:GetPointVec2()
return self.CargoObject:GetPointVec2() return self.CargoObject:GetPointVec2()
end end
--- Get the current Coordinate of the cargo. --- Get the current Coordinate of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return Core.Point#COORDINATE -- @return Core.Point#COORDINATE
function CARGO:GetCoordinate() function CARGO:GetCoordinate()
return self.CargoObject:GetCoordinate() return self.CargoObject:GetCoordinate()
end end
--- Get the weight of the cargo. --- Get the weight of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number Weight The weight in kg. -- @return #number Weight The weight in kg.
function CARGO:GetWeight() function CARGO:GetWeight()
return self.Weight return self.Weight
end end
--- Set the weight of the cargo. --- Set the weight of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @param #number Weight The weight in kg. -- @param #number Weight The weight in kg.
@@ -940,14 +919,14 @@ do -- CARGO
self.Weight = Weight self.Weight = Weight
return self return self
end end
--- Get the volume of the cargo. --- Get the volume of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @return #number Volume The volume in kg. -- @return #number Volume The volume in kg.
function CARGO:GetVolume() function CARGO:GetVolume()
return self.Volume return self.Volume
end end
--- Set the volume of the cargo. --- Set the volume of the cargo.
-- @param #CARGO self -- @param #CARGO self
-- @param #number Volume The volume in kg. -- @param #number Volume The volume in kg.
@@ -956,18 +935,18 @@ do -- CARGO
self.Volume = Volume self.Volume = Volume
return self return self
end end
--- Send a CC message to a @{Wrapper.Group}. --- Send a CC message to a @{Wrapper.Group}.
-- @param #CARGO self -- @param #CARGO self
-- @param #string Message -- @param #string Message
-- @param Wrapper.Group#GROUP CarrierGroup The Carrier Group. -- @param Wrapper.Group#GROUP CarrierGroup The Carrier Group.
-- @param #string Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown. -- @param #string Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown.
function CARGO:MessageToGroup( Message, CarrierGroup, Name ) function CARGO:MessageToGroup( Message, CarrierGroup, Name )
MESSAGE:New( Message, 20, "Cargo " .. self:GetName() ):ToGroup( CarrierGroup ) MESSAGE:New( Message, 20, "Cargo " .. self:GetName() ):ToGroup( CarrierGroup )
end end
--- Report to a Carrier Group. --- Report to a Carrier Group.
-- @param #CARGO self -- @param #CARGO self
-- @param #string Action The string describing the action for the cargo. -- @param #string Action The string describing the action for the cargo.
@@ -993,8 +972,7 @@ do -- CARGO
end end
end end
end end
--- Report to a Carrier Group with a Flaring signal. --- Report to a Carrier Group with a Flaring signal.
-- @param #CARGO self -- @param #CARGO self
-- @param Utils#UTILS.FlareColor FlareColor the color of the flare. -- @param Utils#UTILS.FlareColor FlareColor the color of the flare.
@@ -1003,8 +981,7 @@ do -- CARGO
self.ReportFlareColor = FlareColor self.ReportFlareColor = FlareColor
end end
--- Report to a Carrier Group with a Smoking signal. --- Report to a Carrier Group with a Smoking signal.
-- @param #CARGO self -- @param #CARGO self
-- @param Utils#UTILS.SmokeColor SmokeColor the color of the smoke. -- @param Utils#UTILS.SmokeColor SmokeColor the color of the smoke.
@@ -1013,8 +990,7 @@ do -- CARGO
self.ReportSmokeColor = SmokeColor self.ReportSmokeColor = SmokeColor
end end
--- Reset the reporting for a Carrier Group. --- Reset the reporting for a Carrier Group.
-- @param #CARGO self -- @param #CARGO self
-- @param #string Action The string describing the action for the cargo. -- @param #string Action The string describing the action for the cargo.
@@ -1024,7 +1000,7 @@ do -- CARGO
self.Reported[CarrierGroup][Action] = nil self.Reported[CarrierGroup][Action] = nil
end end
--- Reset all the reporting for a Carrier Group. --- Reset all the reporting for a Carrier Group.
-- @param #CARGO self -- @param #CARGO self
-- @param Wrapper.Group#GROUP CarrierGroup The Carrier Group to send the report to. -- @param Wrapper.Group#GROUP CarrierGroup The Carrier Group to send the report to.
@@ -1033,7 +1009,7 @@ do -- CARGO
self.Reported[CarrierGroup] = nil self.Reported[CarrierGroup] = nil
end end
--- Respawn the cargo when destroyed --- Respawn the cargo when destroyed
-- @param #CARGO self -- @param #CARGO self
-- @param #boolean RespawnDestroyed -- @param #boolean RespawnDestroyed
@@ -1046,11 +1022,8 @@ do -- CARGO
else else
self.onenterDestroyed = nil self.onenterDestroyed = nil
end end
end
end
end -- CARGO end -- CARGO
@@ -1075,7 +1048,7 @@ do -- CARGO_REPRESENTABLE
-- @param #number NearRadius (optional) Radius in meters when the cargo is loaded into the carrier. -- @param #number NearRadius (optional) Radius in meters when the cargo is loaded into the carrier.
-- @return #CARGO_REPRESENTABLE -- @return #CARGO_REPRESENTABLE
function CARGO_REPRESENTABLE:New( CargoObject, Type, Name, LoadRadius, NearRadius ) function CARGO_REPRESENTABLE:New( CargoObject, Type, Name, LoadRadius, NearRadius )
-- Inherit CARGO. -- Inherit CARGO.
local self = BASE:Inherit( self, CARGO:New( Type, Name, 0, LoadRadius, NearRadius ) ) -- #CARGO_REPRESENTABLE local self = BASE:Inherit( self, CARGO:New( Type, Name, 0, LoadRadius, NearRadius ) ) -- #CARGO_REPRESENTABLE
self:F( { Type, Name, LoadRadius, NearRadius } ) self:F( { Type, Name, LoadRadius, NearRadius } )
@@ -1083,10 +1056,10 @@ do -- CARGO_REPRESENTABLE
-- Descriptors. -- Descriptors.
local Desc=CargoObject:GetDesc() local Desc=CargoObject:GetDesc()
self:T({Desc=Desc}) self:T({Desc=Desc})
-- Weight. -- Weight.
local Weight = math.random( 80, 120 ) local Weight = math.random( 80, 120 )
-- Adjust weight.. -- Adjust weight..
if Desc then if Desc then
if Desc.typeName == "2B11 mortar" then if Desc.typeName == "2B11 mortar" then
@@ -1097,8 +1070,8 @@ do -- CARGO_REPRESENTABLE
end end
-- Set weight. -- Set weight.
self:SetWeight( Weight ) self:SetWeight( Weight )
return self return self
end end
@@ -1106,14 +1079,14 @@ do -- CARGO_REPRESENTABLE
-- @param #CARGO_REPRESENTABLE self -- @param #CARGO_REPRESENTABLE self
-- @return #CARGO_REPRESENTABLE -- @return #CARGO_REPRESENTABLE
function CARGO_REPRESENTABLE:Destroy() function CARGO_REPRESENTABLE:Destroy()
-- Cargo objects are deleted from the _DATABASE and SET_CARGO objects. -- Cargo objects are deleted from the _DATABASE and SET_CARGO objects.
self:F( { CargoName = self:GetName() } ) self:F( { CargoName = self:GetName() } )
--_EVENTDISPATCHER:CreateEventDeleteCargo( self ) --_EVENTDISPATCHER:CreateEventDeleteCargo( self )
return self return self
end end
--- Route a cargo unit to a PointVec2. --- Route a cargo unit to a PointVec2.
-- @param #CARGO_REPRESENTABLE self -- @param #CARGO_REPRESENTABLE self
-- @param Core.Point#POINT_VEC2 ToPointVec2 -- @param Core.Point#POINT_VEC2 ToPointVec2
@@ -1121,19 +1094,19 @@ do -- CARGO_REPRESENTABLE
-- @return #CARGO_REPRESENTABLE -- @return #CARGO_REPRESENTABLE
function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed ) function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
self:F2( ToPointVec2 ) self:F2( ToPointVec2 )
local Points = {} local Points = {}
local PointStartVec2 = self.CargoObject:GetPointVec2() local PointStartVec2 = self.CargoObject:GetPointVec2()
Points[#Points+1] = PointStartVec2:WaypointGround( Speed ) Points[#Points+1] = PointStartVec2:WaypointGround( Speed )
Points[#Points+1] = ToPointVec2:WaypointGround( Speed ) Points[#Points+1] = ToPointVec2:WaypointGround( Speed )
local TaskRoute = self.CargoObject:TaskRoute( Points ) local TaskRoute = self.CargoObject:TaskRoute( Points )
self.CargoObject:SetTask( TaskRoute, 2 ) self.CargoObject:SetTask( TaskRoute, 2 )
return self return self
end end
--- Send a message to a @{Wrapper.Group} through a communication channel near the cargo. --- Send a message to a @{Wrapper.Group} through a communication channel near the cargo.
-- @param #CARGO_REPRESENTABLE self -- @param #CARGO_REPRESENTABLE self
-- @param #string Message -- @param #string Message
@@ -1157,20 +1130,19 @@ do -- CARGO_REPRESENTABLE
end end
end end
end end
end end
end -- CARGO_REPRESENTABLE end -- CARGO_REPRESENTABLE
do -- CARGO_REPORTABLE do -- CARGO_REPORTABLE
--- @type CARGO_REPORTABLE --- @type CARGO_REPORTABLE
-- @extends #CARGO -- @extends #CARGO
CARGO_REPORTABLE = { CARGO_REPORTABLE = {
ClassName = "CARGO_REPORTABLE" ClassName = "CARGO_REPORTABLE"
} }
--- CARGO_REPORTABLE Constructor. --- CARGO_REPORTABLE Constructor.
-- @param #CARGO_REPORTABLE self -- @param #CARGO_REPORTABLE self
-- @param #string Type -- @param #string Type
@@ -1182,31 +1154,23 @@ do -- CARGO_REPORTABLE
function CARGO_REPORTABLE:New( Type, Name, Weight, LoadRadius, NearRadius ) function CARGO_REPORTABLE:New( Type, Name, Weight, LoadRadius, NearRadius )
local self = BASE:Inherit( self, CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) ) -- #CARGO_REPORTABLE local self = BASE:Inherit( self, CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) ) -- #CARGO_REPORTABLE
self:F( { Type, Name, Weight, LoadRadius, NearRadius } ) self:F( { Type, Name, Weight, LoadRadius, NearRadius } )
return self return self
end end
--- Send a CC message to a @{Wrapper.Group}. --- Send a CC message to a @{Wrapper.Group}.
-- @param #CARGO_REPORTABLE self -- @param #CARGO_REPORTABLE self
-- @param #string Message -- @param #string Message
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @param #string Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown. -- @param #string Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown.
function CARGO_REPORTABLE:MessageToGroup( Message, TaskGroup, Name ) function CARGO_REPORTABLE:MessageToGroup( Message, TaskGroup, Name )
MESSAGE:New( Message, 20, "Cargo " .. self:GetName() .. " reporting" ):ToGroup( TaskGroup ) MESSAGE:New( Message, 20, "Cargo " .. self:GetName() .. " reporting" ):ToGroup( TaskGroup )
end end
end end
do -- CARGO_PACKAGE do -- CARGO_PACKAGE
--- @type CARGO_PACKAGE --- @type CARGO_PACKAGE
@@ -1280,10 +1244,10 @@ function CARGO_PACKAGE:IsNear( CargoCarrier )
self:F() self:F()
local CargoCarrierPoint = CargoCarrier:GetCoordinate() local CargoCarrierPoint = CargoCarrier:GetCoordinate()
local Distance = CargoCarrierPoint:Get2DDistance( self.CargoCarrier:GetCoordinate() ) local Distance = CargoCarrierPoint:Get2DDistance( self.CargoCarrier:GetCoordinate() )
self:T( Distance ) self:T( Distance )
if Distance <= self.NearRadius then if Distance <= self.NearRadius then
return true return true
else else
@@ -1334,7 +1298,7 @@ function CARGO_PACKAGE:onafterUnBoard( From, Event, To, CargoCarrier, Speed, UnL
if not self.CargoInAir then if not self.CargoInAir then
self:_Next( self.FsmP.UnLoad, UnLoadDistance, Angle ) self:_Next( self.FsmP.UnLoad, UnLoadDistance, Angle )
local Points = {} local Points = {}
local StartPointVec2 = CargoCarrier:GetPointVec2() local StartPointVec2 = CargoCarrier:GetPointVec2()
@@ -1389,7 +1353,7 @@ function CARGO_PACKAGE:onafterLoad( From, Event, To, CargoCarrier, Speed, LoadDi
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees. local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle ) local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
local CargoDeployPointVec2 = StartPointVec2:Translate( LoadDistance, CargoDeployHeading ) local CargoDeployPointVec2 = StartPointVec2:Translate( LoadDistance, CargoDeployHeading )
local Points = {} local Points = {}
Points[#Points+1] = StartPointVec2:WaypointGround( Speed ) Points[#Points+1] = StartPointVec2:WaypointGround( Speed )
Points[#Points+1] = CargoDeployPointVec2:WaypointGround( Speed ) Points[#Points+1] = CargoDeployPointVec2:WaypointGround( Speed )
@@ -1410,12 +1374,12 @@ end
-- @param #number Angle -- @param #number Angle
function CARGO_PACKAGE:onafterUnLoad( From, Event, To, CargoCarrier, Speed, Distance, Angle ) function CARGO_PACKAGE:onafterUnLoad( From, Event, To, CargoCarrier, Speed, Distance, Angle )
self:F() self:F()
local StartPointVec2 = self.CargoCarrier:GetPointVec2() local StartPointVec2 = self.CargoCarrier:GetPointVec2()
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees. local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle ) local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
local CargoDeployPointVec2 = StartPointVec2:Translate( Distance, CargoDeployHeading ) local CargoDeployPointVec2 = StartPointVec2:Translate( Distance, CargoDeployHeading )
self.CargoCarrier = CargoCarrier self.CargoCarrier = CargoCarrier
local Points = {} local Points = {}
@@ -1427,5 +1391,4 @@ function CARGO_PACKAGE:onafterUnLoad( From, Event, To, CargoCarrier, Speed, Dist
end end
end end
+2 -2
View File
@@ -47,7 +47,7 @@ do -- CARGO_GROUP
--- CARGO_GROUP constructor. --- CARGO_GROUP constructor.
-- This make a new CARGO_GROUP from a @{Wrapper.Group} object. -- This make a new CARGO_GROUP from a @{Wrapper.Group} object.
-- It will "ungroup" the group object within the sim, and will create a @{Set} of individual Unit objects. -- It will "ungroup" the group object within the sim, and will create a @{Core.Set} of individual Unit objects.
-- @param #CARGO_GROUP self -- @param #CARGO_GROUP self
-- @param Wrapper.Group#GROUP CargoGroup Group to be transported as cargo. -- @param Wrapper.Group#GROUP CargoGroup Group to be transported as cargo.
-- @param #string Type Cargo type, e.g. "Infantry". This is the type used in SET_CARGO:New():FilterTypes("Infantry") to define the valid cargo groups of the set. -- @param #string Type Cargo type, e.g. "Infantry". This is the type used in SET_CARGO:New():FilterTypes("Infantry") to define the valid cargo groups of the set.
@@ -727,7 +727,7 @@ do -- CARGO_GROUP
end end
end end
--- Check if the first element of the CargoGroup is the given @{Zone}. --- Check if the first element of the CargoGroup is the given @{Core.Zone}.
-- @param #CARGO_GROUP self -- @param #CARGO_GROUP self
-- @param Core.Zone#ZONE_BASE Zone -- @param Core.Zone#ZONE_BASE Zone
-- @return #boolean **true** if the first element of the CargoGroup is in the Zone -- @return #boolean **true** if the first element of the CargoGroup is in the Zone
+13 -13
View File
@@ -51,7 +51,7 @@
-- * PLAYERS -- * PLAYERS
-- * CARGOS -- * CARGOS
-- --
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Group TEMPLATES as defined within the Mission Editor. -- On top, for internal MOOSE administration purposes, the DATABASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
-- --
-- The singleton object **_DATABASE** is automatically created by MOOSE, that administers all objects within the mission. -- The singleton object **_DATABASE** is automatically created by MOOSE, that administers all objects within the mission.
-- Moose refers to **_DATABASE** within the framework extensively, but you can also refer to the _DATABASE object within your missions if required. -- Moose refers to **_DATABASE** within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
@@ -246,7 +246,7 @@ end
do -- Zones do -- Zones
--- Finds a @{Zone} based on the zone name. --- Finds a @{Core.Zone} based on the zone name.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
-- @return Core.Zone#ZONE_BASE The found ZONE. -- @return Core.Zone#ZONE_BASE The found ZONE.
@@ -256,7 +256,7 @@ do -- Zones
return ZoneFound return ZoneFound
end end
--- Adds a @{Zone} based on the zone name in the DATABASE. --- Adds a @{Core.Zone} based on the zone name in the DATABASE.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
-- @param Core.Zone#ZONE_BASE Zone The zone. -- @param Core.Zone#ZONE_BASE Zone The zone.
@@ -268,7 +268,7 @@ do -- Zones
end end
--- Deletes a @{Zone} from the DATABASE based on the zone name. --- Deletes a @{Core.Zone} from the DATABASE based on the zone name.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
function DATABASE:DeleteZone( ZoneName ) function DATABASE:DeleteZone( ZoneName )
@@ -322,7 +322,7 @@ do -- Zones
-- Store color of zone. -- Store color of zone.
Zone.Color=color Zone.Color=color
-- Store zone ID. -- Store zone ID.
Zone.ZoneID=ZoneData.zoneId Zone.ZoneID=ZoneData.zoneId
@@ -379,7 +379,7 @@ end -- zone
do -- Zone_Goal do -- Zone_Goal
--- Finds a @{Zone} based on the zone name. --- Finds a @{Core.Zone} based on the zone name.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
-- @return Core.Zone#ZONE_BASE The found ZONE. -- @return Core.Zone#ZONE_BASE The found ZONE.
@@ -389,7 +389,7 @@ do -- Zone_Goal
return ZoneFound return ZoneFound
end end
--- Adds a @{Zone} based on the zone name in the DATABASE. --- Adds a @{Core.Zone} based on the zone name in the DATABASE.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
-- @param Core.Zone#ZONE_BASE Zone The zone. -- @param Core.Zone#ZONE_BASE Zone The zone.
@@ -401,7 +401,7 @@ do -- Zone_Goal
end end
--- Deletes a @{Zone} from the DATABASE based on the zone name. --- Deletes a @{Core.Zone} from the DATABASE based on the zone name.
-- @param #DATABASE self -- @param #DATABASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
function DATABASE:DeleteZoneGoal( ZoneName ) function DATABASE:DeleteZoneGoal( ZoneName )
@@ -777,7 +777,7 @@ function DATABASE:_RegisterStaticTemplate( StaticTemplate, CoalitionID, Category
local StaticTemplate = UTILS.DeepCopy( StaticTemplate ) local StaticTemplate = UTILS.DeepCopy( StaticTemplate )
local StaticTemplateGroupName = env.getValueDictByKey(StaticTemplate.name) local StaticTemplateGroupName = env.getValueDictByKey(StaticTemplate.name)
local StaticTemplateName=StaticTemplate.units[1].name local StaticTemplateName=StaticTemplate.units[1].name
self.Templates.Statics[StaticTemplateName] = self.Templates.Statics[StaticTemplateName] or {} self.Templates.Statics[StaticTemplateName] = self.Templates.Statics[StaticTemplateName] or {}
@@ -1153,11 +1153,11 @@ function DATABASE:_EventOnDeadOrCrash( Event )
if self.STATICS[Event.IniDCSUnitName] then if self.STATICS[Event.IniDCSUnitName] then
self:DeleteStatic( Event.IniDCSUnitName ) self:DeleteStatic( Event.IniDCSUnitName )
end end
--- ---
-- Maybe a UNIT? -- Maybe a UNIT?
--- ---
-- Delete unit. -- Delete unit.
if self.UNITS[Event.IniDCSUnitName] then if self.UNITS[Event.IniDCSUnitName] then
self:T("STATIC Event for UNIT "..tostring(Event.IniDCSUnitName)) self:T("STATIC Event for UNIT "..tostring(Event.IniDCSUnitName))
@@ -1556,11 +1556,11 @@ function DATABASE:FindOpsGroupFromUnit(unitname)
else else
unit=unitname unit=unitname
end end
if unit then if unit then
groupname=unit:GetGroup():GetName() groupname=unit:GetGroup():GetName()
end end
if groupname then if groupname then
return self.FLIGHTGROUPS[groupname] return self.FLIGHTGROUPS[groupname]
else else
+2 -2
View File
@@ -35,7 +35,7 @@
-- There are 5 types/levels of objects that the _EVENTDISPATCHER services: -- There are 5 types/levels of objects that the _EVENTDISPATCHER services:
-- --
-- * _DATABASE object: The core of the MOOSE objects. Any object that is created, deleted or updated, is done in this database. -- * _DATABASE object: The core of the MOOSE objects. Any object that is created, deleted or updated, is done in this database.
-- * SET_ derived classes: These are subsets of the _DATABASE object. These subsets are updated by the _EVENTDISPATCHER as the second priority. -- * SET_ derived classes: These are subsets of the global _DATABASE object (an instance of @{Core.Database#DATABASE}). These subsets are updated by the _EVENTDISPATCHER as the second priority.
-- * UNIT objects: UNIT objects can subscribe to DCS events. Each DCS event will be directly published to the subscribed UNIT object. -- * UNIT objects: UNIT objects can subscribe to DCS events. Each DCS event will be directly published to the subscribed UNIT object.
-- * GROUP objects: GROUP objects can subscribe to DCS events. Each DCS event will be directly published to the subscribed GROUP object. -- * GROUP objects: GROUP objects can subscribe to DCS events. Each DCS event will be directly published to the subscribed GROUP object.
-- * Any other object: Various other objects can subscribe to DCS events. Each DCS event triggered will be published to each subscribed object. -- * Any other object: Various other objects can subscribe to DCS events. Each DCS event triggered will be published to each subscribed object.
@@ -52,7 +52,7 @@
-- --
-- ![Objects](..\Presentations\EVENT\Dia8.JPG) -- ![Objects](..\Presentations\EVENT\Dia8.JPG)
-- --
-- The actual event subscribing and handling is not facilitated through the _EVENTDISPATCHER, but it is done through the @{BASE} class, @{UNIT} class and @{GROUP} class. -- The actual event subscribing and handling is not facilitated through the _EVENTDISPATCHER, but it is done through the @{Core.Base#BASE} class, @{Wrapper.Unit#UNIT} class and @{Wrapper.Group#GROUP} class.
-- The _EVENTDISPATCHER is a component that is quietly working in the background of MOOSE. -- The _EVENTDISPATCHER is a component that is quietly working in the background of MOOSE.
-- --
-- ![Objects](..\Presentations\EVENT\Dia9.JPG) -- ![Objects](..\Presentations\EVENT\Dia9.JPG)
+15 -15
View File
@@ -47,9 +47,9 @@
-- and tailored** by mission designers through **the implementation of Transition Handlers**. -- and tailored** by mission designers through **the implementation of Transition Handlers**.
-- Each of these FSM implementation classes start either with: -- Each of these FSM implementation classes start either with:
-- --
-- * an acronym **AI\_**, which indicates a FSM implementation directing **AI controlled** @{GROUP} and/or @{UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class. -- * an acronym **AI\_**, which indicates a FSM implementation directing **AI controlled** @{Wrapper.Group#GROUP} and/or @{Wrapper.Unit#UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class.
-- * an acronym **TASK\_**, which indicates a FSM implementation executing a @{TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class. -- * an acronym **TASK\_**, which indicates a FSM implementation executing a @{Tasking.Task#TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class.
-- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{TASK}, seated in a @{CLIENT} (slot) or a @{UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class. -- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{Tasking.Task#TASK}, seated in a @{Wrapper.Client#CLIENT} (slot) or a @{Wrapper.Unit#UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class.
-- --
-- Detailed explanations and API specifics are further below clarified and FSM derived class specifics are described in those class documentation sections. -- Detailed explanations and API specifics are further below clarified and FSM derived class specifics are described in those class documentation sections.
-- --
@@ -61,10 +61,10 @@
-- --
-- The following derived classes are available in the MOOSE framework, that implement a specialized form of a FSM: -- The following derived classes are available in the MOOSE framework, that implement a specialized form of a FSM:
-- --
-- * @{#FSM_TASK}: Models Finite State Machines for @{Task}s. -- * @{#FSM_TASK}: Models Finite State Machines for @{Tasking.Task}s.
-- * @{#FSM_PROCESS}: Models Finite State Machines for @{Task} actions, which control @{Client}s. -- * @{#FSM_PROCESS}: Models Finite State Machines for @{Tasking.Task} actions, which control @{Wrapper.Client}s.
-- * @{#FSM_CONTROLLABLE}: Models Finite State Machines for @{Wrapper.Controllable}s, which are @{Wrapper.Group}s, @{Wrapper.Unit}s, @{Client}s. -- * @{#FSM_CONTROLLABLE}: Models Finite State Machines for @{Wrapper.Controllable}s, which are @{Wrapper.Group}s, @{Wrapper.Unit}s, @{Wrapper.Client}s.
-- * @{#FSM_SET}: Models Finite State Machines for @{Set}s. Note that these FSMs control multiple objects!!! So State concerns here -- * @{#FSM_SET}: Models Finite State Machines for @{Core.Set}s. Note that these FSMs control multiple objects!!! So State concerns here
-- for multiple objects or the position of the state machine in the process. -- for multiple objects or the position of the state machine in the process.
-- --
-- === -- ===
@@ -119,9 +119,9 @@ do -- FSM
-- and tailored** by mission designers through **the implementation of Transition Handlers**. -- and tailored** by mission designers through **the implementation of Transition Handlers**.
-- Each of these FSM implementation classes start either with: -- Each of these FSM implementation classes start either with:
-- --
-- * an acronym **AI\_**, which indicates an FSM implementation directing **AI controlled** @{GROUP} and/or @{UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class. -- * an acronym **AI\_**, which indicates an FSM implementation directing **AI controlled** @{Wrapper.Group#GROUP} and/or @{Wrapper.Unit#UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class.
-- * an acronym **TASK\_**, which indicates an FSM implementation executing a @{TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class. -- * an acronym **TASK\_**, which indicates an FSM implementation executing a @{Tasking.Task#TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class.
-- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{TASK}, seated in a @{CLIENT} (slot) or a @{UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class. -- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{Tasking.Task#TASK}, seated in a @{Wrapper.Client#CLIENT} (slot) or a @{Wrapper.Unit#UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class.
-- --
-- ![Transition Rules and Transition Handlers and Event Triggers](..\Presentations\FSM\Dia3.JPG) -- ![Transition Rules and Transition Handlers and Event Triggers](..\Presentations\FSM\Dia3.JPG)
-- --
@@ -418,7 +418,7 @@ do -- FSM
return self._Transitions or {} return self._Transitions or {}
end end
--- Set the default @{Process} template with key ProcessName providing the ProcessClass and the process object when it is assigned to a @{Wrapper.Controllable} by the task. --- Set the default @{#FSM_PROCESS} template with key ProcessName providing the ProcessClass and the process object when it is assigned to a @{Wrapper.Controllable} by the task.
-- @param #FSM self -- @param #FSM self
-- @param #table From Can contain a string indicating the From state or a table of strings containing multiple From states. -- @param #table From Can contain a string indicating the From state or a table of strings containing multiple From states.
-- @param #string Event The Event name. -- @param #string Event The Event name.
@@ -953,7 +953,7 @@ do -- FSM_CONTROLLABLE
-- @field Wrapper.Controllable#CONTROLLABLE Controllable -- @field Wrapper.Controllable#CONTROLLABLE Controllable
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- Models Finite State Machines for @{Wrapper.Controllable}s, which are @{Wrapper.Group}s, @{Wrapper.Unit}s, @{Client}s. --- Models Finite State Machines for @{Wrapper.Controllable}s, which are @{Wrapper.Group}s, @{Wrapper.Unit}s, @{Wrapper.Client}s.
-- --
-- === -- ===
-- --
@@ -1086,7 +1086,7 @@ do -- FSM_PROCESS
-- @field Tasking.Task#TASK Task -- @field Tasking.Task#TASK Task
-- @extends Core.Fsm#FSM_CONTROLLABLE -- @extends Core.Fsm#FSM_CONTROLLABLE
--- FSM_PROCESS class models Finite State Machines for @{Task} actions, which control @{Client}s. --- FSM_PROCESS class models Finite State Machines for @{Tasking.Task} actions, which control @{Wrapper.Client}s.
-- --
-- === -- ===
-- --
@@ -1241,7 +1241,7 @@ do -- FSM_PROCESS
-- TODO: Need to check and fix that an FSM_PROCESS is only for a UNIT. Not for a GROUP. -- TODO: Need to check and fix that an FSM_PROCESS is only for a UNIT. Not for a GROUP.
--- Send a message of the @{Task} to the Group of the Unit. --- Send a message of the @{Tasking.Task} to the Group of the Unit.
-- @param #FSM_PROCESS self -- @param #FSM_PROCESS self
function FSM_PROCESS:Message( Message ) function FSM_PROCESS:Message( Message )
self:F( { Message = Message } ) self:F( { Message = Message } )
@@ -1382,7 +1382,7 @@ do -- FSM_SET
-- @field Core.Set#SET_BASE Set -- @field Core.Set#SET_BASE Set
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- FSM_SET class models Finite State Machines for @{Set}s. Note that these FSMs control multiple objects!!! So State concerns here --- FSM_SET class models Finite State Machines for @{Core.Set}s. Note that these FSMs control multiple objects!!! So State concerns here
-- for multiple objects or the position of the state machine in the process. -- for multiple objects or the position of the state machine in the process.
-- --
-- === -- ===
+1 -1
View File
@@ -34,7 +34,7 @@
-- --
-- Messages are sent: -- Messages are sent:
-- --
-- * To a @{Client} using @{#MESSAGE.ToClient}(). -- * To a @{Wrapper.Client} using @{#MESSAGE.ToClient}().
-- * To a @{Wrapper.Group} using @{#MESSAGE.ToGroup}() -- * To a @{Wrapper.Group} using @{#MESSAGE.ToGroup}()
-- * To a @{Wrapper.Unit} using @{#MESSAGE.ToUnit}() -- * To a @{Wrapper.Unit} using @{#MESSAGE.ToUnit}()
-- * To a coalition using @{#MESSAGE.ToCoalition}(). -- * To a coalition using @{#MESSAGE.ToCoalition}().
+12 -12
View File
@@ -138,7 +138,7 @@ do -- COORDINATE
-- --
-- Calculate if the coordinate has Line of Sight (LOS) with the other given coordinate. -- Calculate if the coordinate has Line of Sight (LOS) with the other given coordinate.
-- Mountains, trees and other objects can be positioned between the two 3D points, preventing visibilty in a straight continuous line. -- Mountains, trees and other objects can be positioned between the two 3D points, preventing visibilty in a straight continuous line.
-- The method @{#COORDINATE.IsLOS}() returns if the two coodinates have LOS. -- The method @{#COORDINATE.IsLOS}() returns if the two coordinates have LOS.
-- --
-- ## 4.7) Check the coordinate position. -- ## 4.7) Check the coordinate position.
-- --
@@ -654,7 +654,7 @@ do -- COORDINATE
-- @param DCS#Distance Distance The Distance to be added in meters. -- @param DCS#Distance Distance The Distance to be added in meters.
-- @param DCS#Angle Angle The Angle in degrees. Defaults to 0 if not specified (nil). -- @param DCS#Angle Angle The Angle in degrees. Defaults to 0 if not specified (nil).
-- @param #boolean Keepalt If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height. -- @param #boolean Keepalt If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height.
-- @param #boolean Overwrite If true, overwrite the original COORDINATE with the translated one. Otherwise, create a new COODINATE. -- @param #boolean Overwrite If true, overwrite the original COORDINATE with the translated one. Otherwise, create a new COORDINATE.
-- @return #COORDINATE The new calculated COORDINATE. -- @return #COORDINATE The new calculated COORDINATE.
function COORDINATE:Translate( Distance, Angle, Keepalt, Overwrite ) function COORDINATE:Translate( Distance, Angle, Keepalt, Overwrite )
@@ -3323,21 +3323,21 @@ do -- POINT_VEC3
--- Return the x coordinate of the POINT_VEC3. --- Return the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @return #number The x coodinate. -- @return #number The x coordinate.
function POINT_VEC3:GetX() function POINT_VEC3:GetX()
return self.x return self.x
end end
--- Return the y coordinate of the POINT_VEC3. --- Return the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @return #number The y coodinate. -- @return #number The y coordinate.
function POINT_VEC3:GetY() function POINT_VEC3:GetY()
return self.y return self.y
end end
--- Return the z coordinate of the POINT_VEC3. --- Return the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @return #number The z coodinate. -- @return #number The z coordinate.
function POINT_VEC3:GetZ() function POINT_VEC3:GetZ()
return self.z return self.z
end end
@@ -3371,7 +3371,7 @@ do -- POINT_VEC3
--- Add to the x coordinate of the POINT_VEC3. --- Add to the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @param #number x The x coordinate value to add to the current x coodinate. -- @param #number x The x coordinate value to add to the current x coordinate.
-- @return #POINT_VEC3 -- @return #POINT_VEC3
function POINT_VEC3:AddX( x ) function POINT_VEC3:AddX( x )
self.x = self.x + x self.x = self.x + x
@@ -3380,7 +3380,7 @@ do -- POINT_VEC3
--- Add to the y coordinate of the POINT_VEC3. --- Add to the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @param #number y The y coordinate value to add to the current y coodinate. -- @param #number y The y coordinate value to add to the current y coordinate.
-- @return #POINT_VEC3 -- @return #POINT_VEC3
function POINT_VEC3:AddY( y ) function POINT_VEC3:AddY( y )
self.y = self.y + y self.y = self.y + y
@@ -3389,7 +3389,7 @@ do -- POINT_VEC3
--- Add to the z coordinate of the POINT_VEC3. --- Add to the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self -- @param #POINT_VEC3 self
-- @param #number z The z coordinate value to add to the current z coodinate. -- @param #number z The z coordinate value to add to the current z coordinate.
-- @return #POINT_VEC3 -- @return #POINT_VEC3
function POINT_VEC3:AddZ( z ) function POINT_VEC3:AddZ( z )
self.z = self.z +z self.z = self.z +z
@@ -3495,14 +3495,14 @@ do -- POINT_VEC2
--- Return the x coordinate of the POINT_VEC2. --- Return the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self -- @param #POINT_VEC2 self
-- @return #number The x coodinate. -- @return #number The x coordinate.
function POINT_VEC2:GetX() function POINT_VEC2:GetX()
return self.x return self.x
end end
--- Return the y coordinate of the POINT_VEC2. --- Return the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self -- @param #POINT_VEC2 self
-- @return #number The y coodinate. -- @return #number The y coordinate.
function POINT_VEC2:GetY() function POINT_VEC2:GetY()
return self.z return self.z
end end
@@ -3527,7 +3527,7 @@ do -- POINT_VEC2
--- Return Return the Lat(itude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.x). --- Return Return the Lat(itude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.x).
-- @param #POINT_VEC2 self -- @param #POINT_VEC2 self
-- @return #number The x coodinate. -- @return #number The x coordinate.
function POINT_VEC2:GetLat() function POINT_VEC2:GetLat()
return self.x return self.x
end end
@@ -3543,7 +3543,7 @@ do -- POINT_VEC2
--- Return the Lon(gitude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.z). --- Return the Lon(gitude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.z).
-- @param #POINT_VEC2 self -- @param #POINT_VEC2 self
-- @return #number The y coodinate. -- @return #number The y coordinate.
function POINT_VEC2:GetLon() function POINT_VEC2:GetLon()
return self.z return self.z
end end
+34 -34
View File
@@ -22,11 +22,11 @@
-- * @{#SET_GROUP}: Defines a collection of @{Wrapper.Group}s filtered by filter criteria. -- * @{#SET_GROUP}: Defines a collection of @{Wrapper.Group}s filtered by filter criteria.
-- * @{#SET_UNIT}: Defines a collection of @{Wrapper.Unit}s filtered by filter criteria. -- * @{#SET_UNIT}: Defines a collection of @{Wrapper.Unit}s filtered by filter criteria.
-- * @{#SET_STATIC}: Defines a collection of @{Wrapper.Static}s filtered by filter criteria. -- * @{#SET_STATIC}: Defines a collection of @{Wrapper.Static}s filtered by filter criteria.
-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filtered by filter criteria. -- * @{#SET_CLIENT}: Defines a collection of @{Wrapper.Client}s filtered by filter criteria.
-- * @{#SET_AIRBASE}: Defines a collection of @{Wrapper.Airbase}s filtered by filter criteria. -- * @{#SET_AIRBASE}: Defines a collection of @{Wrapper.Airbase}s filtered by filter criteria.
-- * @{#SET_CARGO}: Defines a collection of @{Cargo.Cargo}s filtered by filter criteria. -- * @{#SET_CARGO}: Defines a collection of @{Cargo.Cargo}s filtered by filter criteria.
-- * @{#SET_ZONE}: Defines a collection of @{Core.Zone}s filtered by filter criteria. -- * @{#SET_ZONE}: Defines a collection of @{Core.Zone}s filtered by filter criteria.
-- * @{#SET_SCENERY}: Defines a collection of @{Warpper.Scenery}s added via a filtered @{#SET_ZONE}. -- * @{#SET_SCENERY}: Defines a collection of @{Wrapper.Scenery}s added via a filtered @{#SET_ZONE}.
-- --
-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage the collections. -- These classes are derived from @{#SET_BASE}, which contains the main methods to manage the collections.
-- --
@@ -930,9 +930,9 @@ do -- SET_GROUP
-- The following iterator methods are currently available within the SET_GROUP: -- The following iterator methods are currently available within the SET_GROUP:
-- --
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP. -- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function. -- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function. -- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function. -- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- --
-- --
-- ## SET_GROUP trigger events on the GROUP objects. -- ## SET_GROUP trigger events on the GROUP objects.
@@ -1486,7 +1486,7 @@ do -- SET_GROUP
end end
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function. --- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- @param #SET_GROUP self -- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
@@ -1508,7 +1508,7 @@ do -- SET_GROUP
return self return self
end end
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function. --- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- @param #SET_GROUP self -- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
@@ -1530,7 +1530,7 @@ do -- SET_GROUP
return self return self
end end
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function. --- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Core.Zone}, providing the GROUP and optional parameters to the called function.
-- @param #SET_GROUP self -- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter. -- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
@@ -1624,7 +1624,7 @@ do -- SET_GROUP
return false return false
end end
--- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE} --- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{Wrapper.Group#GROUP} of the @{#SET_GROUP} is in @{Core.Zone}
-- @param #SET_GROUP self -- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completely inside the @{Core.Zone#ZONE}, false otherwise. -- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completely inside the @{Core.Zone#ZONE}, false otherwise.
@@ -1649,8 +1649,8 @@ do -- SET_GROUP
return false return false
end end
--- Iterate the SET_GROUP and return true if at least one @{GROUP} of the @{SET_GROUP} is partly in @{ZONE}. --- Iterate the SET_GROUP and return true if at least one @{Wrapper.Group#GROUP} of the @{#SET_GROUP} is partly in @{Core.Zone}.
-- Will return false if a @{GROUP} is fully in the @{ZONE} -- Will return false if a @{Wrapper.Group#GROUP} is fully in the @{Core.Zone}
-- @param #SET_GROUP self -- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completely inside the @{Core.Zone#ZONE}, false otherwise. -- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completely inside the @{Core.Zone#ZONE}, false otherwise.
@@ -1683,7 +1683,7 @@ do -- SET_GROUP
end end
end end
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE} --- Iterate the SET_GROUP and return true if no @{Wrapper.Group#GROUP} of the @{#SET_GROUP} is in @{Core.Zone}
-- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the -- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the
-- mission designer to add a dedicated method -- mission designer to add a dedicated method
-- @param #SET_GROUP self -- @param #SET_GROUP self
@@ -1952,14 +1952,14 @@ do -- SET_UNIT
-- The following iterator methods are currently available within the SET_UNIT: -- The following iterator methods are currently available within the SET_UNIT:
-- --
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT. -- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitInZone}: Iterate the SET_UNIT and call an iterator function for each **alive** UNIT object presence completely in a @{Zone}, providing the UNIT object and optional parameters to the called function. -- * @{#SET_UNIT.ForEachUnitInZone}: Iterate the SET_UNIT and call an iterator function for each **alive** UNIT object presence completely in a @{Core.Zone}, providing the UNIT object and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate the SET_UNIT and call an iterator function for each **alive** UNIT object presence not in a @{Zone}, providing the UNIT object and optional parameters to the called function. -- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate the SET_UNIT and call an iterator function for each **alive** UNIT object presence not in a @{Core.Zone}, providing the UNIT object and optional parameters to the called function.
-- --
-- Planned iterators methods in development are (so these are not yet available): -- Planned iterators methods in development are (so these are not yet available):
-- --
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT. -- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function. -- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Core.Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function. -- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Core.Zone}, providing the UNIT and optional parameters to the called function.
-- --
-- ## 5) SET_UNIT atomic methods -- ## 5) SET_UNIT atomic methods
-- --
@@ -2501,7 +2501,7 @@ do -- SET_UNIT
return self return self
end end
--- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function. --- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence completely in a @{Core.Zone}, providing the UNIT and optional parameters to the called function.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.
@@ -2523,7 +2523,7 @@ do -- SET_UNIT
return self return self
end end
--- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function. --- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence not in a @{Core.Zone}, providing the UNIT and optional parameters to the called function.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.
@@ -2574,7 +2574,7 @@ do -- SET_UNIT
return UnitTypes return UnitTypes
end end
--- Returns a comma separated string of the unit types with a count in the @{Set}. --- Returns a comma separated string of the unit types with a count in the @{Core.Set}.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @return #string The unit types string -- @return #string The unit types string
function SET_UNIT:GetUnitTypesText() function SET_UNIT:GetUnitTypesText()
@@ -2746,7 +2746,7 @@ do -- SET_UNIT
end end
--- Returns if the @{Set} has targets having a radar (of a given type). --- Returns if the @{Core.Set} has targets having a radar (of a given type).
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @param DCS#Unit.RadarType RadarType -- @param DCS#Unit.RadarType RadarType
-- @return #number The amount of radars in the Set with the given type -- @return #number The amount of radars in the Set with the given type
@@ -2771,7 +2771,7 @@ do -- SET_UNIT
return RadarCount return RadarCount
end end
--- Returns if the @{Set} has targets that can be SEADed. --- Returns if the @{Core.Set} has targets that can be SEADed.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @return #number The amount of SEADable units in the Set -- @return #number The amount of SEADable units in the Set
function SET_UNIT:HasSEAD() function SET_UNIT:HasSEAD()
@@ -2795,7 +2795,7 @@ do -- SET_UNIT
return SEADCount return SEADCount
end end
--- Returns if the @{Set} has ground targets. --- Returns if the @{Core.Set} has ground targets.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @return #number The amount of ground targets in the Set. -- @return #number The amount of ground targets in the Set.
function SET_UNIT:HasGroundUnits() function SET_UNIT:HasGroundUnits()
@@ -2812,7 +2812,7 @@ do -- SET_UNIT
return GroundUnitCount return GroundUnitCount
end end
--- Returns if the @{Set} has air targets. --- Returns if the @{Core.Set} has air targets.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @return #number The amount of air targets in the Set. -- @return #number The amount of air targets in the Set.
function SET_UNIT:HasAirUnits() function SET_UNIT:HasAirUnits()
@@ -2829,7 +2829,7 @@ do -- SET_UNIT
return AirUnitCount return AirUnitCount
end end
--- Returns if the @{Set} has friendly ground units. --- Returns if the @{Core.Set} has friendly ground units.
-- @param #SET_UNIT self -- @param #SET_UNIT self
-- @return #number The amount of ground targets in the Set. -- @return #number The amount of ground targets in the Set.
function SET_UNIT:HasFriendlyUnits( FriendlyCoalition ) function SET_UNIT:HasFriendlyUnits( FriendlyCoalition )
@@ -3075,9 +3075,9 @@ do -- SET_STATIC
-- The following iterator methods are currently available within the SET_STATIC: -- The following iterator methods are currently available within the SET_STATIC:
-- --
-- * @{#SET_STATIC.ForEachStatic}: Calls a function for each alive unit it finds within the SET_STATIC. -- * @{#SET_STATIC.ForEachStatic}: Calls a function for each alive unit it finds within the SET_STATIC.
-- * @{#SET_STATIC.ForEachStaticCompletelyInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Zone}, providing the STATIC and optional parameters to the called function. -- * @{#SET_STATIC.ForEachStaticCompletelyInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Core.Zone}, providing the STATIC and optional parameters to the called function.
-- * @{#SET_STATIC.ForEachStaticInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Zone}, providing the STATIC and optional parameters to the called function. -- * @{#SET_STATIC.ForEachStaticInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Core.Zone}, providing the STATIC and optional parameters to the called function.
-- * @{#SET_STATIC.ForEachStaticNotInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence not in a @{Zone}, providing the STATIC and optional parameters to the called function. -- * @{#SET_STATIC.ForEachStaticNotInZone}: Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence not in a @{Core.Zone}, providing the STATIC and optional parameters to the called function.
-- --
-- ## SET_STATIC atomic methods -- ## SET_STATIC atomic methods
-- --
@@ -3441,7 +3441,7 @@ do -- SET_STATIC
return self return self
end end
--- Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Zone}, providing the STATIC and optional parameters to the called function. --- Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence completely in a @{Core.Zone}, providing the STATIC and optional parameters to the called function.
-- @param #SET_STATIC self -- @param #SET_STATIC self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive STATIC in the SET_STATIC. The function needs to accept a STATIC parameter. -- @param #function IteratorFunction The function that will be called when there is an alive STATIC in the SET_STATIC. The function needs to accept a STATIC parameter.
@@ -3463,7 +3463,7 @@ do -- SET_STATIC
return self return self
end end
--- Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence not in a @{Zone}, providing the STATIC and optional parameters to the called function. --- Iterate the SET_STATIC and call an iterator function for each **alive** STATIC presence not in a @{Core.Zone}, providing the STATIC and optional parameters to the called function.
-- @param #SET_STATIC self -- @param #SET_STATIC self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive STATIC in the SET_STATIC. The function needs to accept a STATIC parameter. -- @param #function IteratorFunction The function that will be called when there is an alive STATIC in the SET_STATIC. The function needs to accept a STATIC parameter.
@@ -3514,7 +3514,7 @@ do -- SET_STATIC
return StaticTypes return StaticTypes
end end
--- Returns a comma separated string of the unit types with a count in the @{Set}. --- Returns a comma separated string of the unit types with a count in the @{Core.Set}.
-- @param #SET_STATIC self -- @param #SET_STATIC self
-- @return #string The unit types string -- @return #string The unit types string
function SET_STATIC:GetStaticTypesText() function SET_STATIC:GetStaticTypesText()
@@ -4073,7 +4073,7 @@ do -- SET_CLIENT
return self return self
end end
--- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence completely in a @{Zone}, providing the CLIENT and optional parameters to the called function. --- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence completely in a @{Core.Zone}, providing the CLIENT and optional parameters to the called function.
-- @param #SET_CLIENT self -- @param #SET_CLIENT self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter.
@@ -4095,7 +4095,7 @@ do -- SET_CLIENT
return self return self
end end
--- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence not in a @{Zone}, providing the CLIENT and optional parameters to the called function. --- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence not in a @{Core.Zone}, providing the CLIENT and optional parameters to the called function.
-- @param #SET_CLIENT self -- @param #SET_CLIENT self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter.
@@ -4545,7 +4545,7 @@ do -- SET_PLAYER
return self return self
end end
--- Iterate the SET_PLAYER and call an iterator function for each **alive** CLIENT presence completely in a @{Zone}, providing the CLIENT and optional parameters to the called function. --- Iterate the SET_PLAYER and call an iterator function for each **alive** CLIENT presence completely in a @{Core.Zone}, providing the CLIENT and optional parameters to the called function.
-- @param #SET_PLAYER self -- @param #SET_PLAYER self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_PLAYER. The function needs to accept a CLIENT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_PLAYER. The function needs to accept a CLIENT parameter.
@@ -4567,7 +4567,7 @@ do -- SET_PLAYER
return self return self
end end
--- Iterate the SET_PLAYER and call an iterator function for each **alive** CLIENT presence not in a @{Zone}, providing the CLIENT and optional parameters to the called function. --- Iterate the SET_PLAYER and call an iterator function for each **alive** CLIENT presence not in a @{Core.Zone}, providing the CLIENT and optional parameters to the called function.
-- @param #SET_PLAYER self -- @param #SET_PLAYER self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for. -- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_PLAYER. The function needs to accept a CLIENT parameter. -- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_PLAYER. The function needs to accept a CLIENT parameter.
+12 -12
View File
@@ -167,7 +167,7 @@
-- --
-- * @{#SPAWN.InitRandomizePosition}(): Randomizes the position of @{Wrapper.Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens. -- * @{#SPAWN.InitRandomizePosition}(): Randomizes the position of @{Wrapper.Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Wrapper.Unit}s in the @{Wrapper.Group} that is spawned within a **radius band**, given an Outer and Inner radius. -- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Wrapper.Unit}s in the @{Wrapper.Group} that is spawned within a **radius band**, given an Outer and Inner radius.
-- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Zone}s that are declared using this function. Each zone can be given a probability factor. -- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Core.Zone}s that are declared using this function. Each zone can be given a probability factor.
-- --
-- ### Enable / Disable AI when spawning a new @{Wrapper.Group} -- ### Enable / Disable AI when spawning a new @{Wrapper.Group}
-- --
@@ -202,11 +202,11 @@
-- * @{#SPAWN.SpawnFromVec2}(): Spawn a new group from a Vec2 coordinate. (The group will be spawned at land height ). -- * @{#SPAWN.SpawnFromVec2}(): Spawn a new group from a Vec2 coordinate. (The group will be spawned at land height ).
-- * @{#SPAWN.SpawnFromStatic}(): Spawn a new group from a structure, taking the position of a @{Wrapper.Static}. -- * @{#SPAWN.SpawnFromStatic}(): Spawn a new group from a structure, taking the position of a @{Wrapper.Static}.
-- * @{#SPAWN.SpawnFromUnit}(): Spawn a new group taking the position of a @{Wrapper.Unit}. -- * @{#SPAWN.SpawnFromUnit}(): Spawn a new group taking the position of a @{Wrapper.Unit}.
-- * @{#SPAWN.SpawnInZone}(): Spawn a new group in a @{Zone}. -- * @{#SPAWN.SpawnInZone}(): Spawn a new group in a @{Core.Zone}.
-- * @{#SPAWN.SpawnAtAirbase}(): Spawn a new group at an @{Wrapper.Airbase}, which can be an airdrome, ship or helipad. -- * @{#SPAWN.SpawnAtAirbase}(): Spawn a new group at an @{Wrapper.Airbase}, which can be an airdrome, ship or helipad.
-- --
-- Note that @{#SPAWN.Spawn} and @{#SPAWN.ReSpawn} return a @{Wrapper.Group#GROUP.New} object, that contains a reference to the DCSGroup object. -- Note that @{#SPAWN.Spawn} and @{#SPAWN.ReSpawn} return a @{Wrapper.Group#GROUP.New} object, that contains a reference to the DCSGroup object.
-- You can use the @{GROUP} object to do further actions with the DCSGroup. -- You can use the @{Wrapper.Group#GROUP} object to do further actions with the DCSGroup.
-- --
-- ### **Scheduled** spawning methods -- ### **Scheduled** spawning methods
-- --
@@ -765,7 +765,7 @@ end
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius. --- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{UNIT}s position within the group between a given outer and inner radius. -- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{Wrapper.Unit#UNIT}s position within the group between a given outer and inner radius.
-- @param DCS#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned. -- @param DCS#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
-- @param DCS#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned. -- @param DCS#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
-- @return #SPAWN -- @return #SPAWN
@@ -906,7 +906,7 @@ end
--- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types. --- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #table SpawnZoneTable A table with @{Zone} objects. If this table is given, then each spawn will be executed within the given list of @{Zone}s objects. -- @param #table SpawnZoneTable A table with @{Core.Zone} objects. If this table is given, then each spawn will be executed within the given list of @{Core.Zone}s objects.
-- @return #SPAWN -- @return #SPAWN
-- @usage -- @usage
-- --
@@ -1159,7 +1159,7 @@ do -- Delay methods
end -- Delay methods end -- Delay methods
--- Will spawn a group based on the internal index. --- Will spawn a group based on the internal index.
-- Note: Uses @{DATABASE} module defined in MOOSE. -- Note: This method uses the global _DATABASE object (an instance of @{Core.Database#DATABASE}), which contains ALL initial and new spawned objects in MOOSE.
-- @param #SPAWN self -- @param #SPAWN self
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions. -- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
function SPAWN:Spawn() function SPAWN:Spawn()
@@ -1174,7 +1174,7 @@ function SPAWN:Spawn()
end end
--- Will re-spawn a group based on a given index. --- Will re-spawn a group based on a given index.
-- Note: Uses @{DATABASE} module defined in MOOSE. -- Note: This method uses the global _DATABASE object (an instance of @{Core.Database#DATABASE}), which contains ALL initial and new spawned objects in MOOSE.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #string SpawnIndex The index of the group to be spawned. -- @param #string SpawnIndex The index of the group to be spawned.
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions. -- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
@@ -1222,7 +1222,7 @@ function SPAWN:SetSpawnIndex( SpawnIndex )
end end
--- Will spawn a group with a specified index number. --- Will spawn a group with a specified index number.
-- Uses @{DATABASE} global object defined in MOOSE. -- Note: This method uses the global _DATABASE object (an instance of @{Core.Database#DATABASE}), which contains ALL initial and new spawned objects in MOOSE.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #string SpawnIndex The index of the group to be spawned. -- @param #string SpawnIndex The index of the group to be spawned.
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions. -- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
@@ -2615,8 +2615,8 @@ function SPAWN:SpawnFromStatic( HostStatic, MinHeight, MaxHeight, SpawnIndex )
return nil return nil
end end
--- Will spawn a Group within a given @{Zone}. --- Will spawn a Group within a given @{Core.Zone}.
-- The @{Zone} can be of any type derived from @{Core.Zone#ZONE_BASE}. -- The @{Core.Zone} can be of any type derived from @{Core.Zone#ZONE_BASE}.
-- Once the @{Wrapper.Group} is spawned within the zone, the @{Wrapper.Group} will continue on its route. -- Once the @{Wrapper.Group} is spawned within the zone, the @{Wrapper.Group} will continue on its route.
-- The **first waypoint** (where the group is spawned) is replaced with the zone location coordinates. -- The **first waypoint** (where the group is spawned) is replaced with the zone location coordinates.
-- @param #SPAWN self -- @param #SPAWN self
@@ -2937,7 +2937,7 @@ function SPAWN:_GetGroupCountryID( SpawnPrefix )
end end
--- Gets the Group Template from the ME environment definition. --- Gets the Group Template from the ME environment definition.
-- This method used the @{DATABASE} object, which contains ALL initial and new spawned object in MOOSE. -- Note: This method uses the global _DATABASE object (an instance of @{Core.Database#DATABASE}), which contains ALL initial and new spawned objects in MOOSE.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #string SpawnTemplatePrefix -- @param #string SpawnTemplatePrefix
-- @return @SPAWN self -- @return @SPAWN self
@@ -3108,7 +3108,7 @@ function SPAWN:_RandomizeTemplate( SpawnIndex )
return self return self
end end
--- Private method that randomizes the @{Zone}s where the Group will be spawned. --- Private method that randomizes the @{Core.Zone}s where the Group will be spawned.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #number SpawnIndex -- @param #number SpawnIndex
-- @return #SPAWN self -- @return #SPAWN self
+2 -2
View File
@@ -106,7 +106,7 @@
-- * @{#SPAWNSTATIC.Spawn}(Heading, NewName) spawns the static with the set parameters. Optionally, heading and name can be given. The name **must be unique**! -- * @{#SPAWNSTATIC.Spawn}(Heading, NewName) spawns the static with the set parameters. Optionally, heading and name can be given. The name **must be unique**!
-- * @{#SPAWNSTATIC.SpawnFromCoordinate}(Coordinate, Heading, NewName) spawn the static at the given coordinate. Optionally, heading and name can be given. The name **must be unique**! -- * @{#SPAWNSTATIC.SpawnFromCoordinate}(Coordinate, Heading, NewName) spawn the static at the given coordinate. Optionally, heading and name can be given. The name **must be unique**!
-- * @{#SPAWNSTATIC.SpawnFromPointVec2}(PointVec2, Heading, NewName) spawns the static at a POINT_VEC2 coordinate. Optionally, heading and name can be given. The name **must be unique**! -- * @{#SPAWNSTATIC.SpawnFromPointVec2}(PointVec2, Heading, NewName) spawns the static at a POINT_VEC2 coordinate. Optionally, heading and name can be given. The name **must be unique**!
-- * @{#SPAWNSTATIC.SpawnFromZone}(Zone, Heading, NewName) spawns the static at the center of a @{Zone}. Optionally, heading and name can be given. The name **must be unique**! -- * @{#SPAWNSTATIC.SpawnFromZone}(Zone, Heading, NewName) spawns the static at the center of a @{Core.Zone}. Optionally, heading and name can be given. The name **must be unique**!
-- --
-- @field #SPAWNSTATIC SPAWNSTATIC -- @field #SPAWNSTATIC SPAWNSTATIC
-- --
@@ -375,7 +375,7 @@ function SPAWNSTATIC:SpawnFromCoordinate(Coordinate, Heading, NewName)
end end
--- Creates a new @{Wrapper.Static} from a @{Zone}. --- Creates a new @{Wrapper.Static} from a @{Core.Zone}.
-- @param #SPAWNSTATIC self -- @param #SPAWNSTATIC self
-- @param Core.Zone#ZONE_BASE Zone The Zone where to spawn the static. -- @param Core.Zone#ZONE_BASE Zone The Zone where to spawn the static.
-- @param #number Heading (Optional)The heading of the static in degrees. Default is the heading of the template. -- @param #number Heading (Optional)The heading of the static in degrees. Default is the heading of the template.
+48 -79
View File
@@ -53,7 +53,6 @@
-- @module Core.Zone -- @module Core.Zone
-- @image Core_Zones.JPG -- @image Core_Zones.JPG
--- @type ZONE_BASE --- @type ZONE_BASE
-- @field #string ZoneName Name of the zone. -- @field #string ZoneName Name of the zone.
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability. -- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
@@ -75,7 +74,7 @@
-- * @{#ZONE_BASE.SetName}(): Sets the name of the zone. -- * @{#ZONE_BASE.SetName}(): Sets the name of the zone.
-- --
-- --
-- ## Each zone implements two polymorphic functions defined in @{Core.Zone#ZONE_BASE}: -- ## Each zone implements two polymorphic functions defined in @{#ZONE_BASE}:
-- --
-- * @{#ZONE_BASE.IsVec2InZone}(): Returns if a 2D vector is within the zone. -- * @{#ZONE_BASE.IsVec2InZone}(): Returns if a 2D vector is within the zone.
-- * @{#ZONE_BASE.IsVec3InZone}(): Returns if a 3D vector is within the zone. -- * @{#ZONE_BASE.IsVec3InZone}(): Returns if a 3D vector is within the zone.
@@ -121,10 +120,9 @@ ZONE_BASE = {
Color={}, Color={},
ZoneID=nil, ZoneID=nil,
Properties={}, Properties={},
Sureface=nil, Surface=nil,
} }
--- The ZONE_BASE.BoundingSquare --- The ZONE_BASE.BoundingSquare
-- @type ZONE_BASE.BoundingSquare -- @type ZONE_BASE.BoundingSquare
-- @field DCS#Distance x1 The lower x coordinate (left down) -- @field DCS#Distance x1 The lower x coordinate (left down)
@@ -132,7 +130,6 @@ ZONE_BASE = {
-- @field DCS#Distance x2 The higher x coordinate (right up) -- @field DCS#Distance x2 The higher x coordinate (right up)
-- @field DCS#Distance y2 The higher y coordinate (right up) -- @field DCS#Distance y2 The higher y coordinate (right up)
--- ZONE_BASE constructor --- ZONE_BASE constructor
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @param #string ZoneName Name of the zone. -- @param #string ZoneName Name of the zone.
@@ -142,14 +139,12 @@ function ZONE_BASE:New( ZoneName )
self:F( ZoneName ) self:F( ZoneName )
self.ZoneName = ZoneName self.ZoneName = ZoneName
--_DATABASE:AddZone(ZoneName,self) --_DATABASE:AddZone(ZoneName,self)
return self return self
end end
--- Returns the name of the zone. --- Returns the name of the zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @return #string The name of the zone. -- @return #string The name of the zone.
@@ -159,7 +154,6 @@ function ZONE_BASE:GetName()
return self.ZoneName return self.ZoneName
end end
--- Sets the name of the zone. --- Sets the name of the zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @param #string ZoneName The name of the zone. -- @param #string ZoneName The name of the zone.
@@ -217,7 +211,6 @@ function ZONE_BASE:IsPointVec3InZone( PointVec3 )
return InZone return InZone
end end
--- Returns the @{DCS#Vec2} coordinate of the zone. --- Returns the @{DCS#Vec2} coordinate of the zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @return #nil. -- @return #nil.
@@ -241,7 +234,6 @@ function ZONE_BASE:GetPointVec2()
return PointVec2 return PointVec2
end end
--- Returns the @{DCS#Vec3} of the zone. --- Returns the @{DCS#Vec3} of the zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
@@ -365,7 +357,6 @@ function ZONE_BASE:BoundZone()
self:F2() self:F2()
end end
--- Set draw coalition of zone. --- Set draw coalition of zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @param #number Coalition Coalition. Default -1. -- @param #number Coalition Coalition. Default -1.
@@ -377,7 +368,7 @@ end
--- Get draw coalition of zone. --- Get draw coalition of zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @return #number Draw coaliton. -- @return #number Draw coalition.
function ZONE_BASE:GetDrawCoalition() function ZONE_BASE:GetDrawCoalition()
return self.drawCoalition or -1 return self.drawCoalition or -1
end end
@@ -385,7 +376,7 @@ end
--- Set color of zone. --- Set color of zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`. -- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`.
-- @param #number Alpha Transparacy between 0 and 1. Default 0.15. -- @param #number Alpha Transparency between 0 and 1. Default 0.15.
-- @return #ZONE_BASE self -- @return #ZONE_BASE self
function ZONE_BASE:SetColor(RGBcolor, Alpha) function ZONE_BASE:SetColor(RGBcolor, Alpha)
@@ -420,7 +411,7 @@ function ZONE_BASE:GetColorRGB()
return rgb return rgb
end end
--- Get transperency Alpha value of zone. --- Get transparency Alpha value of zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @return #number Alpha value. -- @return #number Alpha value.
function ZONE_BASE:GetColorAlpha() function ZONE_BASE:GetColorAlpha()
@@ -467,7 +458,7 @@ function ZONE_BASE:GetFillColorRGB()
return rgb return rgb
end end
--- Get transperency Alpha fill value of zone. --- Get transparency Alpha fill value of zone.
-- @param #ZONE_BASE self -- @param #ZONE_BASE self
-- @return #number Alpha value. -- @return #number Alpha value.
function ZONE_BASE:GetFillColorAlpha() function ZONE_BASE:GetFillColorAlpha()
@@ -592,7 +583,7 @@ end
-- @extends #ZONE_BASE -- @extends #ZONE_BASE
--- The ZONE_RADIUS class defined by a zone name, a location and a radius. --- The ZONE_RADIUS class defined by a zone name, a location and a radius.
-- This class implements the inherited functions from Core.Zone#ZONE_BASE taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_BASE} taking into account the own zone format and properties.
-- --
-- ## ZONE_RADIUS constructor -- ## ZONE_RADIUS constructor
-- --
@@ -631,7 +622,7 @@ ZONE_RADIUS = {
-- @param #string ZoneName Name of the zone. -- @param #string ZoneName Name of the zone.
-- @param DCS#Vec2 Vec2 The location of the zone. -- @param DCS#Vec2 Vec2 The location of the zone.
-- @param DCS#Distance Radius The radius of the zone. -- @param DCS#Distance Radius The radius of the zone.
-- @param DCS#Boolean DoNotRegisterZone Determins if the Zone should not be registered in the _Database Table. Default=false -- @param DCS#Boolean DoNotRegisterZone Determines if the Zone should not be registered in the _Database Table. Default=false
-- @return #ZONE_RADIUS self -- @return #ZONE_RADIUS self
function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone ) function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone )
@@ -755,7 +746,6 @@ function ZONE_RADIUS:BoundZone( Points, CountryID, UnBound )
local Angle local Angle
local RadialBase = math.pi*2 local RadialBase = math.pi*2
--
for Angle = 0, 360, (360 / Points ) do for Angle = 0, 360, (360 / Points ) do
local Radial = Angle * RadialBase / 360 local Radial = Angle * RadialBase / 360
Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius() Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius()
@@ -785,7 +775,6 @@ function ZONE_RADIUS:BoundZone( Points, CountryID, UnBound )
return self return self
end end
--- Smokes the zone boundaries in a color. --- Smokes the zone boundaries in a color.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color. -- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color.
@@ -817,7 +806,6 @@ function ZONE_RADIUS:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset )
return self return self
end end
--- Flares the zone boundaries in a color. --- Flares the zone boundaries in a color.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param Utilities.Utils#FLARECOLOR FlareColor The flare color. -- @param Utilities.Utils#FLARECOLOR FlareColor The flare color.
@@ -914,7 +902,6 @@ function ZONE_RADIUS:GetVec3( Height )
return Vec3 return Vec3
end end
--- Scan the zone for the presence of units of the given ObjectCategories. --- Scan the zone for the presence of units of the given ObjectCategories.
-- Note that **only after** a zone has been scanned, the zone can be evaluated by: -- Note that **only after** a zone has been scanned, the zone can be evaluated by:
-- --
@@ -955,7 +942,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
if ZoneObject then if ZoneObject then
local ObjectCategory = ZoneObject:getCategory() local ObjectCategory = ZoneObject:getCategory()
--local name=ZoneObject:getName() --local name=ZoneObject:getName()
--env.info(string.format("Zone object %s", tostring(name))) --env.info(string.format("Zone object %s", tostring(name)))
--self:E(ZoneObject) --self:E(ZoneObject)
@@ -1022,7 +1009,6 @@ function ZONE_RADIUS:GetScannedUnits()
return self.ScanData.Units return self.ScanData.Units
end end
--- Get a set of scanned units. --- Get a set of scanned units.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @return Core.Set#SET_UNIT Set of units and statics inside the zone. -- @return Core.Set#SET_UNIT Set of units and statics inside the zone.
@@ -1076,7 +1062,6 @@ function ZONE_RADIUS:GetScannedSetGroup()
return self.ScanSetGroup return self.ScanSetGroup
end end
--- Count the number of different coalitions inside the zone. --- Count the number of different coalitions inside the zone.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @return #number Counted coalitions. -- @return #number Counted coalitions.
@@ -1129,7 +1114,6 @@ function ZONE_RADIUS:GetScannedCoalition( Coalition )
end end
end end
--- Get scanned scenery type --- Get scanned scenery type
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @return #table Table of DCS scenery type objects. -- @return #table Table of DCS scenery type objects.
@@ -1137,7 +1121,6 @@ function ZONE_RADIUS:GetScannedSceneryType( SceneryType )
return self.ScanData.Scenery[SceneryType] return self.ScanData.Scenery[SceneryType]
end end
--- Get scanned scenery table --- Get scanned scenery table
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @return #table Structured object table: [type].[name].SCENERY -- @return #table Structured object table: [type].[name].SCENERY
@@ -1165,7 +1148,7 @@ function ZONE_RADIUS:GetScannedSetScenery()
end end
--- Is All in Zone of Coalition? --- Is All in Zone of Coalition?
-- Check if only the specifed coalition is inside the zone and noone else. -- Check if only the specified coalition is inside the zone and no one else.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param #number Coalition Coalition ID of the coalition which is checked to be the only one in the zone. -- @param #number Coalition Coalition ID of the coalition which is checked to be the only one in the zone.
-- @return #boolean True, if **only** that coalition is inside the zone and no one else. -- @return #boolean True, if **only** that coalition is inside the zone and no one else.
@@ -1178,7 +1161,6 @@ function ZONE_RADIUS:IsAllInZoneOfCoalition( Coalition )
return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == true return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == true
end end
--- Is All in Zone of Other Coalition? --- Is All in Zone of Other Coalition?
-- Check if only one coalition is inside the zone and the specified coalition is not the one. -- Check if only one coalition is inside the zone and the specified coalition is not the one.
-- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated! -- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated!
@@ -1195,13 +1177,12 @@ function ZONE_RADIUS:IsAllInZoneOfOtherCoalition( Coalition )
return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == nil return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == nil
end end
--- Is Some in Zone of Coalition? --- Is Some in Zone of Coalition?
-- Check if more than one coaltion is inside the zone and the specifed coalition is one of them. -- Check if more than one coalition is inside the zone and the specified coalition is one of them.
-- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated! -- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set. -- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param #number Coalition ID of the coaliton which is checked to be inside the zone. -- @param #number Coalition ID of the coalition which is checked to be inside the zone.
-- @return #boolean True if more than one coalition is inside the zone and the specified coalition is one of them. -- @return #boolean True if more than one coalition is inside the zone and the specified coalition is one of them.
-- @usage -- @usage
-- self.Zone:Scan() -- self.Zone:Scan()
@@ -1211,7 +1192,6 @@ function ZONE_RADIUS:IsSomeInZoneOfCoalition( Coalition )
return self:CountScannedCoalitions() > 1 and self:GetScannedCoalition( Coalition ) == true return self:CountScannedCoalitions() > 1 and self:GetScannedCoalition( Coalition ) == true
end end
--- Is None in Zone of Coalition? --- Is None in Zone of Coalition?
-- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated! -- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set. -- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
@@ -1226,7 +1206,6 @@ function ZONE_RADIUS:IsNoneInZoneOfCoalition( Coalition )
return self:GetScannedCoalition( Coalition ) == nil return self:GetScannedCoalition( Coalition ) == nil
end end
--- Is None in Zone? --- Is None in Zone?
-- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated! -- You first need to use the @{#ZONE_RADIUS.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set. -- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
@@ -1240,9 +1219,6 @@ function ZONE_RADIUS:IsNoneInZone()
return self:CountScannedCoalitions() == 0 return self:CountScannedCoalitions() == 0
end end
--- Searches the zone --- Searches the zone
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param ObjectCategories A list of categories, which are members of Object.Category -- @param ObjectCategories A list of categories, which are members of Object.Category
@@ -1282,9 +1258,9 @@ end
-- @return #boolean true if the location is within the zone. -- @return #boolean true if the location is within the zone.
function ZONE_RADIUS:IsVec2InZone( Vec2 ) function ZONE_RADIUS:IsVec2InZone( Vec2 )
self:F2( Vec2 ) self:F2( Vec2 )
if not Vec2 then return false end if not Vec2 then return false end
local ZoneVec2 = self:GetVec2() local ZoneVec2 = self:GetVec2()
if ZoneVec2 then if ZoneVec2 then
@@ -1352,7 +1328,7 @@ function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)
--env.info(string.format("Got random coordinate with surface type %d after N=%d/%d iterations", land.getSurfaceType(point), N, Nmax)) --env.info(string.format("Got random coordinate with surface type %d after N=%d/%d iterations", land.getSurfaceType(point), N, Nmax))
else else
point=_getpoint() point=_getpoint()
N=N+1 N=N+1
end end
end end
end end
@@ -1427,27 +1403,26 @@ end
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param #number inner (Optional) Minimal distance from the center of the zone in meters. Default is 0m. -- @param #number inner (Optional) Minimal distance from the center of the zone in meters. Default is 0m.
-- @param #number outer (Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone. -- @param #number outer (Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone.
-- @param #number distance (Optional) Minumum distance from any building coordinate. Defaults to 100m. -- @param #number distance (Optional) Minimum distance from any building coordinate. Defaults to 100m.
-- @param #boolean markbuildings (Optional) Place markers on found buildings (if any). -- @param #boolean markbuildings (Optional) Place markers on found buildings (if any).
-- @param #boolean markfinal (Optional) Place marker on the final coordinate (if any). -- @param #boolean markfinal (Optional) Place marker on the final coordinate (if any).
-- @return Core.Point#COORDINATE The random coordinate or `nil` if cannot be found in 1000 iterations. -- @return Core.Point#COORDINATE The random coordinate or `nil` if cannot be found in 1000 iterations.
function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,markbuildings,markfinal) function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,markbuildings,markfinal)
local dist = distance or 100 local dist = distance or 100
local objects = {} local objects = {}
if self.ScanData and self.ScanData.Scenery then if self.ScanData and self.ScanData.Scenery then
objects = self:GetScannedScenery() objects = self:GetScannedScenery()
else else
self:Scan({Object.Category.SCENERY}) self:Scan({Object.Category.SCENERY})
objects = self:GetScannedScenery() objects = self:GetScannedScenery()
end end
local T0 = timer.getTime() local T0 = timer.getTime()
local T1 = timer.getTime() local T1 = timer.getTime()
local buildings = {} local buildings = {}
if self.ScanData and self.ScanData.BuildingCoordinates then if self.ScanData and self.ScanData.BuildingCoordinates then
buildings = self.ScanData.BuildingCoordinates buildings = self.ScanData.BuildingCoordinates
@@ -1467,12 +1442,12 @@ function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,ma
end end
self.ScanData.BuildingCoordinates = buildings self.ScanData.BuildingCoordinates = buildings
end end
-- max 1000 tries -- max 1000 tries
local rcoord = nil local rcoord = nil
local found = false local found = false
local iterations = 0 local iterations = 0
for i=1,1000 do for i=1,1000 do
iterations = iterations + 1 iterations = iterations + 1
rcoord = self:GetRandomCoordinate(inner,outer) rcoord = self:GetRandomCoordinate(inner,outer)
@@ -1593,7 +1568,7 @@ end
-- @extends Core.Zone#ZONE_RADIUS -- @extends Core.Zone#ZONE_RADIUS
--- # ZONE_UNIT class, extends @{Zone#ZONE_RADIUS} --- # ZONE_UNIT class, extends @{#ZONE_RADIUS}
-- --
-- The ZONE_UNIT class defined by a zone attached to a @{Wrapper.Unit#UNIT} with a radius and optional offsets. -- The ZONE_UNIT class defined by a zone attached to a @{Wrapper.Unit#UNIT} with a radius and optional offsets.
-- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
@@ -1733,7 +1708,7 @@ end
--- The ZONE_GROUP class defines by a zone around a @{Wrapper.Group#GROUP} with a radius. The current leader of the group defines the center of the zone. --- The ZONE_GROUP class defines by a zone around a @{Wrapper.Group#GROUP} with a radius. The current leader of the group defines the center of the zone.
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
-- --
-- @field #ZONE_GROUP -- @field #ZONE_GROUP
ZONE_GROUP = { ZONE_GROUP = {
@@ -1820,7 +1795,7 @@ end
--- The ZONE_POLYGON_BASE class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon. --- The ZONE_POLYGON_BASE class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
-- This class is an abstract BASE class for derived classes, and is not meant to be instantiated. -- This class is an abstract BASE class for derived classes, and is not meant to be instantiated.
-- --
-- ## Zone point randomization -- ## Zone point randomization
@@ -2052,7 +2027,6 @@ function ZONE_POLYGON_BASE:BoundZone( UnBound )
return self return self
end end
--- Draw the zone on the F10 map. **NOTE** Currently, only polygons **up to ten points** are supported! --- Draw the zone on the F10 map. **NOTE** Currently, only polygons **up to ten points** are supported!
-- @param #ZONE_POLYGON_BASE self -- @param #ZONE_POLYGON_BASE self
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
@@ -2068,43 +2042,43 @@ function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlph
if self._.Polygon and #self._.Polygon>=3 then if self._.Polygon and #self._.Polygon>=3 then
local coordinate=COORDINATE:NewFromVec2(self._.Polygon[1]) local coordinate=COORDINATE:NewFromVec2(self._.Polygon[1])
Coalition=Coalition or self:GetDrawCoalition() Coalition=Coalition or self:GetDrawCoalition()
-- Set draw coalition. -- Set draw coalition.
self:SetDrawCoalition(Coalition) self:SetDrawCoalition(Coalition)
Color=Color or self:GetColorRGB() Color=Color or self:GetColorRGB()
Alpha=Alpha or 1 Alpha=Alpha or 1
-- Set color. -- Set color.
self:SetColor(Color, Alpha) self:SetColor(Color, Alpha)
FillColor=FillColor or self:GetFillColorRGB() FillColor=FillColor or self:GetFillColorRGB()
if not FillColor then UTILS.DeepCopy(Color) end if not FillColor then UTILS.DeepCopy(Color) end
FillAlpha=FillAlpha or self:GetFillColorAlpha() FillAlpha=FillAlpha or self:GetFillColorAlpha()
if not FillAlpha then FillAlpha=0.15 end if not FillAlpha then FillAlpha=0.15 end
-- Set fill color. -- Set fill color.
self:SetFillColor(FillColor, FillAlpha) self:SetFillColor(FillColor, FillAlpha)
if #self._.Polygon==4 then if #self._.Polygon==4 then
local Coord2=COORDINATE:NewFromVec2(self._.Polygon[2]) local Coord2=COORDINATE:NewFromVec2(self._.Polygon[2])
local Coord3=COORDINATE:NewFromVec2(self._.Polygon[3]) local Coord3=COORDINATE:NewFromVec2(self._.Polygon[3])
local Coord4=COORDINATE:NewFromVec2(self._.Polygon[4]) local Coord4=COORDINATE:NewFromVec2(self._.Polygon[4])
self.DrawID=coordinate:QuadToAll(Coord2, Coord3, Coord4, Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly) self.DrawID=coordinate:QuadToAll(Coord2, Coord3, Coord4, Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)
else else
local Coordinates=self:GetVerticiesCoordinates() local Coordinates=self:GetVerticiesCoordinates()
table.remove(Coordinates, 1) table.remove(Coordinates, 1)
self.DrawID=coordinate:MarkupToAllFreeForm(Coordinates, Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly) self.DrawID=coordinate:MarkupToAllFreeForm(Coordinates, Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)
end end
end end
return self return self
@@ -2141,7 +2115,6 @@ function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments )
return self return self
end end
--- Flare the zone boundaries in a color. --- Flare the zone boundaries in a color.
-- @param #ZONE_POLYGON_BASE self -- @param #ZONE_POLYGON_BASE self
-- @param Utilities.Utils#FLARECOLOR FlareColor The flare color. -- @param Utilities.Utils#FLARECOLOR FlareColor The flare color.
@@ -2177,9 +2150,6 @@ function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight )
return self return self
end end
--- Returns if a location is within the zone. --- Returns if a location is within the zone.
-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html -- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
-- @param #ZONE_POLYGON_BASE self -- @param #ZONE_POLYGON_BASE self
@@ -2361,7 +2331,7 @@ end
--- The ZONE_POLYGON class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon. --- The ZONE_POLYGON class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
-- --
-- ## Declare a ZONE_POLYGON directly in the DCS mission editor! -- ## Declare a ZONE_POLYGON directly in the DCS mission editor!
-- --
@@ -2724,7 +2694,7 @@ function ZONE_POLYGON:GetScannedSetScenery()
end end
--- Is All in Zone of Coalition? --- Is All in Zone of Coalition?
-- Check if only the specifed coalition is inside the zone and noone else. -- Check if only the specified coalition is inside the zone and noone else.
-- @param #ZONE_POLYGON self -- @param #ZONE_POLYGON self
-- @param #number Coalition Coalition ID of the coalition which is checked to be the only one in the zone. -- @param #number Coalition Coalition ID of the coalition which is checked to be the only one in the zone.
-- @return #boolean True, if **only** that coalition is inside the zone and no one else. -- @return #boolean True, if **only** that coalition is inside the zone and no one else.
@@ -2750,11 +2720,11 @@ function ZONE_POLYGON:IsAllInZoneOfOtherCoalition( Coalition )
end end
--- Is Some in Zone of Coalition? --- Is Some in Zone of Coalition?
-- Check if more than one coaltion is inside the zone and the specifed coalition is one of them. -- Check if more than one coalition is inside the zone and the specified coalition is one of them.
-- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated! -- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set. -- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_POLYGON self -- @param #ZONE_POLYGON self
-- @param #number Coalition ID of the coaliton which is checked to be inside the zone. -- @param #number Coalition ID of the coalition which is checked to be inside the zone.
-- @return #boolean True if more than one coalition is inside the zone and the specified coalition is one of them. -- @return #boolean True if more than one coalition is inside the zone and the specified coalition is one of them.
-- @usage -- @usage
-- self.Zone:Scan() -- self.Zone:Scan()
@@ -2999,7 +2969,7 @@ do -- ZONE_AIRBASE
--- The ZONE_AIRBASE class defines by a zone around a @{Wrapper.Airbase#AIRBASE} with a radius. --- The ZONE_AIRBASE class defines by a zone around a @{Wrapper.Airbase#AIRBASE} with a radius.
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties. -- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
-- --
-- @field #ZONE_AIRBASE -- @field #ZONE_AIRBASE
ZONE_AIRBASE = { ZONE_AIRBASE = {
@@ -3086,5 +3056,4 @@ do -- ZONE_AIRBASE
return PointVec2 return PointVec2
end end
end end
@@ -3422,7 +3422,7 @@ function ARTY:onafterMove(Controllable, From, Event, To, move)
-- Set current move. -- Set current move.
self.currentMove=move self.currentMove=move
-- Route group to coodinate. -- Route group to coordinate.
self:_Move(self.Controllable, move.coord, move.speed, move.onroad) self:_Move(self.Controllable, move.coord, move.speed, move.onroad)
end end
@@ -48,7 +48,7 @@
-- --
-- ![Banner Image](..\Presentations\DESIGNATE\Dia3.JPG) -- ![Banner Image](..\Presentations\DESIGNATE\Dia3.JPG)
-- --
-- A typical mission setup would require Recce (a @{Set} of Recce) to be detecting potential targets. -- A typical mission setup would require Recce (a @{Core.Set} of Recce) to be detecting potential targets.
-- The DetectionObject will group the detected targets based on the detection method being used. -- The DetectionObject will group the detected targets based on the detection method being used.
-- Possible detection methods could be by Area, by Type or by Unit. -- Possible detection methods could be by Area, by Type or by Unit.
-- Each grouping will result in a **TargetGroup**, for terminology and clarity we will use this term throughout the document. -- Each grouping will result in a **TargetGroup**, for terminology and clarity we will use this term throughout the document.
@@ -276,7 +276,7 @@ do -- DESIGNATE
-- # 7. Designate Menu Location for a Mission -- # 7. Designate Menu Location for a Mission
-- --
-- You can make DESIGNATE work for a @{Tasking.Mission#MISSION} object. In this way, the designate menu will not appear in the root of the radio menu, but in the menu of the Mission. -- You can make DESIGNATE work for a @{Tasking.Mission#MISSION} object. In this way, the designate menu will not appear in the root of the radio menu, but in the menu of the Mission.
-- Use the method @{#DESIGNATE.SetMission}() to set the @{Mission} object for the designate function. -- Use the method @{#DESIGNATE.SetMission}() to set the @{Tasking.Mission} object for the designate function.
-- --
-- # 8. Status Report -- # 8. Status Report
-- --
@@ -40,7 +40,7 @@
do -- DETECTION_BASE do -- DETECTION_BASE
--- @type DETECTION_BASE --- @type DETECTION_BASE
-- @field Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role. -- @field Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Forward Air Controller role.
-- @field DCS#Distance DetectionRange The range till which targets are accepted to be detected. -- @field DCS#Distance DetectionRange The range till which targets are accepted to be detected.
-- @field #DETECTION_BASE.DetectedObjects DetectedObjects The list of detected objects. -- @field #DETECTION_BASE.DetectedObjects DetectedObjects The list of detected objects.
-- @field #table DetectedObjectsIdentified Map of the DetectedObjects identified. -- @field #table DetectedObjectsIdentified Map of the DetectedObjects identified.
@@ -318,7 +318,7 @@ do -- DETECTION_BASE
--- DETECTION constructor. --- DETECTION constructor.
-- @param #DETECTION_BASE self -- @param #DETECTION_BASE self
-- @param Core.Set#SET_GROUP DetectionSet The @{Set} of @{Group}s that is used to detect the units. -- @param Core.Set#SET_GROUP DetectionSet The @{Core.Set} of @{Wrapper.Group}s that is used to detect the units.
-- @return #DETECTION_BASE self -- @return #DETECTION_BASE self
function DETECTION_BASE:New( DetectionSet ) function DETECTION_BASE:New( DetectionSet )
@@ -1982,7 +1982,7 @@ do -- DETECTION_UNITS
--- Will detect units within the battle zone. --- Will detect units within the battle zone.
-- --
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Core.Set#SET_UNIT} containing ONE @{UNIT} object reference. -- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Core.Set#SET_UNIT} containing ONE @{Wrapper.Unit#UNIT} object reference.
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also. -- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
-- --
-- @field #DETECTION_UNITS -- @field #DETECTION_UNITS
@@ -1993,7 +1993,7 @@ do -- DETECTION_UNITS
--- DETECTION_UNITS constructor. --- DETECTION_UNITS constructor.
-- @param Functional.Detection#DETECTION_UNITS self -- @param Functional.Detection#DETECTION_UNITS self
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role. -- @param Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Forward Air Controller role.
-- @return Functional.Detection#DETECTION_UNITS self -- @return Functional.Detection#DETECTION_UNITS self
function DETECTION_UNITS:New( DetectionSetGroup ) function DETECTION_UNITS:New( DetectionSetGroup )
@@ -2237,7 +2237,7 @@ do -- DETECTION_TYPES
--- Will detect units within the battle zone. --- Will detect units within the battle zone.
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected. -- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
-- Each DetectedItem will contain a field Set, which contains a @{Core.Set#SET_UNIT} containing ONE @{UNIT} object reference. -- Each DetectedItem will contain a field Set, which contains a @{Core.Set#SET_UNIT} containing ONE @{Wrapper.Unit#UNIT} object reference.
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also. -- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
-- --
-- @field #DETECTION_TYPES -- @field #DETECTION_TYPES
@@ -2248,7 +2248,7 @@ do -- DETECTION_TYPES
--- DETECTION_TYPES constructor. --- DETECTION_TYPES constructor.
-- @param Functional.Detection#DETECTION_TYPES self -- @param Functional.Detection#DETECTION_TYPES self
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Recce role. -- @param Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Recce role.
-- @return Functional.Detection#DETECTION_TYPES self -- @return Functional.Detection#DETECTION_TYPES self
function DETECTION_TYPES:New( DetectionSetGroup ) function DETECTION_TYPES:New( DetectionSetGroup )
@@ -2436,7 +2436,7 @@ do -- DETECTION_AREAS
--- @type DETECTION_AREAS --- @type DETECTION_AREAS
-- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target. -- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange. -- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Core.Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
-- @extends Functional.Detection#DETECTION_BASE -- @extends Functional.Detection#DETECTION_BASE
--- Detect units within the battle zone for a list of @{Wrapper.Group}s detecting targets following (a) detection method(s), --- Detect units within the battle zone for a list of @{Wrapper.Group}s detecting targets following (a) detection method(s),
@@ -2477,7 +2477,7 @@ do -- DETECTION_AREAS
--- DETECTION_AREAS constructor. --- DETECTION_AREAS constructor.
-- @param #DETECTION_AREAS self -- @param #DETECTION_AREAS self
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role. -- @param Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Forward Air Controller role.
-- @param DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target. -- @param DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
-- @return #DETECTION_AREAS -- @return #DETECTION_AREAS
function DETECTION_AREAS:New( DetectionSetGroup, DetectionZoneRange ) function DETECTION_AREAS:New( DetectionSetGroup, DetectionZoneRange )
@@ -2498,7 +2498,7 @@ do -- DETECTION_AREAS
--- Retrieve set of detected zones. --- Retrieve set of detected zones.
-- @param #DETECTION_AREAS self -- @param #DETECTION_AREAS self
-- @return Core.Set#SET_ZONE The @{Set} of ZONE_UNIT objects detected. -- @return Core.Set#SET_ZONE The @{Core.Set} of ZONE_UNIT objects detected.
function DETECTION_AREAS:GetDetectionZones() function DETECTION_AREAS:GetDetectionZones()
local zoneset = SET_ZONE:New() local zoneset = SET_ZONE:New()
for _ID,_Item in pairs (self.DetectedItems) do for _ID,_Item in pairs (self.DetectedItems) do
@@ -6,7 +6,7 @@ do -- DETECTION_ZONES
--- @type DETECTION_ZONES --- @type DETECTION_ZONES
-- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target. -- @field DCS#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange. -- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Wrapper.Unit}s, @{Core.Zone}s, the center @{Wrapper.Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
-- @extends Functional.Detection#DETECTION_BASE -- @extends Functional.Detection#DETECTION_BASE
--- (old, to be revised ) Detect units within the battle zone for a list of @{Core.Zone}s detecting targets following (a) detection method(s), --- (old, to be revised ) Detect units within the battle zone for a list of @{Core.Zone}s detecting targets following (a) detection method(s),
@@ -48,7 +48,7 @@ do -- DETECTION_ZONES
--- DETECTION_ZONES constructor. --- DETECTION_ZONES constructor.
-- @param #DETECTION_ZONES self -- @param #DETECTION_ZONES self
-- @param Core.Set#SET_ZONE DetectionSetZone The @{Set} of ZONE_RADIUS. -- @param Core.Set#SET_ZONE DetectionSetZone The @{Core.Set} of ZONE_RADIUS.
-- @param DCS#Coalition.side DetectionCoalition The coalition of the detection. -- @param DCS#Coalition.side DetectionCoalition The coalition of the detection.
-- @return #DETECTION_ZONES -- @return #DETECTION_ZONES
function DETECTION_ZONES:New( DetectionSetZone, DetectionCoalition ) function DETECTION_ZONES:New( DetectionSetZone, DetectionCoalition )
@@ -214,7 +214,7 @@
-- * grouping = 5000 (meters) - Detection (EWR) will group enemy flights to areas of 5km for tracking - `MANTIS:SetEWRGrouping(radius)` -- * grouping = 5000 (meters) - Detection (EWR) will group enemy flights to areas of 5km for tracking - `MANTIS:SetEWRGrouping(radius)`
-- * detectinterval = 30 (seconds) - MANTIS will decide every 30 seconds which SAM to activate - `MANTIS:SetDetectInterval(interval)` -- * detectinterval = 30 (seconds) - MANTIS will decide every 30 seconds which SAM to activate - `MANTIS:SetDetectInterval(interval)`
-- * engagerange = 95 (percent) - SAMs will only fire if flights are inside of a 95% radius of their max firerange - `MANTIS:SetSAMRange(range)` -- * engagerange = 95 (percent) - SAMs will only fire if flights are inside of a 95% radius of their max firerange - `MANTIS:SetSAMRange(range)`
-- * dynamic = false - Group filtering is set to once, i.e. newly added groups will not be part of the setup by default - `MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic)` -- * dynamic = false - Group filtering is set to once, i.e. newly added groups will not be part of the setup by default - `MANTIS:New(name,samprefix,ewrprefix,hq,coalition,dynamic)`
-- * autorelocate = false - HQ and (mobile) EWR system will not relocate in random intervals between 30mins and 1 hour - `MANTIS:SetAutoRelocate(hq, ewr)` -- * autorelocate = false - HQ and (mobile) EWR system will not relocate in random intervals between 30mins and 1 hour - `MANTIS:SetAutoRelocate(hq, ewr)`
-- * debug = false - Debugging reports on screen are set to off - `MANTIS:Debug(onoff)` -- * debug = false - Debugging reports on screen are set to off - `MANTIS:Debug(onoff)`
-- --
@@ -424,7 +424,7 @@ do
--@param #string samprefix Prefixes for the SAM groups from the ME, e.g. all groups starting with "Red Sam..." --@param #string samprefix Prefixes for the SAM groups from the ME, e.g. all groups starting with "Red Sam..."
--@param #string ewrprefix Prefixes for the EWR groups from the ME, e.g. all groups starting with "Red EWR..." --@param #string ewrprefix Prefixes for the EWR groups from the ME, e.g. all groups starting with "Red EWR..."
--@param #string hq Group name of your HQ (optional) --@param #string hq Group name of your HQ (optional)
--@param #string coaltion Coalition side of your setup, e.g. "blue", "red" or "neutral" --@param #string coalition Coalition side of your setup, e.g. "blue", "red" or "neutral"
--@param #boolean dynamic Use constant (true) filtering or just filter once (false, default) (optional) --@param #boolean dynamic Use constant (true) filtering or just filter once (false, default) (optional)
--@param #string awacs Group name of your Awacs (optional) --@param #string awacs Group name of your Awacs (optional)
--@param #boolean EmOnOff Make MANTIS switch Emissions on and off instead of changing the alarm state between RED and GREEN (optional) --@param #boolean EmOnOff Make MANTIS switch Emissions on and off instead of changing the alarm state between RED and GREEN (optional)
@@ -447,7 +447,7 @@ do
-- mybluemantis = MANTIS:New("bluemantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs") -- mybluemantis = MANTIS:New("bluemantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")
-- mybluemantis:Start() -- mybluemantis:Start()
-- --
function MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic,awacs, EmOnOff, Padding) function MANTIS:New(name,samprefix,ewrprefix,hq,coalition,dynamic,awacs, EmOnOff, Padding)
-- DONE: Create some user functions for these -- DONE: Create some user functions for these
-- DONE: Make HQ useful -- DONE: Make HQ useful
@@ -460,7 +460,7 @@ do
self.SAM_Templates_Prefix = samprefix or "Red SAM" self.SAM_Templates_Prefix = samprefix or "Red SAM"
self.EWR_Templates_Prefix = ewrprefix or "Red EWR" self.EWR_Templates_Prefix = ewrprefix or "Red EWR"
self.HQ_Template_CC = hq or nil self.HQ_Template_CC = hq or nil
self.Coalition = coaltion or "red" self.Coalition = coalition or "red"
self.SAM_Table = {} self.SAM_Table = {}
self.SAM_Table_Long = {} self.SAM_Table_Long = {}
self.SAM_Table_Medium = {} self.SAM_Table_Medium = {}
@@ -28,14 +28,14 @@
-- * **Messages Off**: Disable all messages. -- * **Messages Off**: Disable all messages.
-- * **Tracking**: Menu to configure missile tracking messages. -- * **Tracking**: Menu to configure missile tracking messages.
-- * **To All**: Shows missile tracking messages to all players. -- * **To All**: Shows missile tracking messages to all players.
-- * **To Target**: Shows missile tracking messages only to the player where the missile is targetted at. -- * **To Target**: Shows missile tracking messages only to the player where the missile is targeted at.
-- * **Tracking On**: Show missile tracking messages. -- * **Tracking On**: Show missile tracking messages.
-- * **Tracking Off**: Disable missile tracking messages. -- * **Tracking Off**: Disable missile tracking messages.
-- * **Frequency Increase**: Increases the missile tracking message frequency with one second. -- * **Frequency Increase**: Increases the missile tracking message frequency with one second.
-- * **Frequency Decrease**: Decreases the missile tracking message frequency with one second. -- * **Frequency Decrease**: Decreases the missile tracking message frequency with one second.
-- * **Alerts**: Menu to configure alert messages. -- * **Alerts**: Menu to configure alert messages.
-- * **To All**: Shows alert messages to all players. -- * **To All**: Shows alert messages to all players.
-- * **To Target**: Shows alert messages only to the player where the missile is (was) targetted at. -- * **To Target**: Shows alert messages only to the player where the missile is (was) targeted at.
-- * **Hits On**: Show missile hit alert messages. -- * **Hits On**: Show missile hit alert messages.
-- * **Hits Off**: Disable missile hit alert messages. -- * **Hits Off**: Disable missile hit alert messages.
-- * **Launches On**: Show missile launch messages. -- * **Launches On**: Show missile launch messages.
@@ -88,7 +88,7 @@
-- A MISSILETRAINER object will behave differently based on the usage of initialization methods: -- A MISSILETRAINER object will behave differently based on the usage of initialization methods:
-- --
-- * @{#MISSILETRAINER.InitMessagesOnOff}: Sets by default the display of any message to be ON or OFF. -- * @{#MISSILETRAINER.InitMessagesOnOff}: Sets by default the display of any message to be ON or OFF.
-- * @{#MISSILETRAINER.InitTrackingToAll}: Sets by default the missile tracking report for all players or only for those missiles targetted to you. -- * @{#MISSILETRAINER.InitTrackingToAll}: Sets by default the missile tracking report for all players or only for those missiles targeted to you.
-- * @{#MISSILETRAINER.InitTrackingOnOff}: Sets by default the display of missile tracking report to be ON or OFF. -- * @{#MISSILETRAINER.InitTrackingOnOff}: Sets by default the display of missile tracking report to be ON or OFF.
-- * @{#MISSILETRAINER.InitTrackingFrequency}: Increases, decreases the missile tracking message display frequency with the provided time interval in seconds. -- * @{#MISSILETRAINER.InitTrackingFrequency}: Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.
-- * @{#MISSILETRAINER.InitAlertsToAll}: Sets by default the display of alerts to be shown to all players or only to you. -- * @{#MISSILETRAINER.InitAlertsToAll}: Sets by default the display of alerts to be shown to all players or only to you.
@@ -256,7 +256,7 @@ function MISSILETRAINER:InitMessagesOnOff( MessagesOnOff )
return self return self
end end
--- Sets by default the missile tracking report for all players or only for those missiles targetted to you. --- Sets by default the missile tracking report for all players or only for those missiles targeted to you.
-- @param #MISSILETRAINER self -- @param #MISSILETRAINER self
-- @param #boolean TrackingToAll true or false -- @param #boolean TrackingToAll true or false
-- @return #MISSILETRAINER self -- @return #MISSILETRAINER self
+11 -11
View File
@@ -30,23 +30,23 @@ MOVEMENT = {
function MOVEMENT:New( MovePrefixes, MoveMaximum ) function MOVEMENT:New( MovePrefixes, MoveMaximum )
local self = BASE:Inherit( self, BASE:New() ) -- #MOVEMENT local self = BASE:Inherit( self, BASE:New() ) -- #MOVEMENT
self:F( { MovePrefixes, MoveMaximum } ) self:F( { MovePrefixes, MoveMaximum } )
if type( MovePrefixes ) == 'table' then if type( MovePrefixes ) == 'table' then
self.MovePrefixes = MovePrefixes self.MovePrefixes = MovePrefixes
else else
self.MovePrefixes = { MovePrefixes } self.MovePrefixes = { MovePrefixes }
end end
self.MoveCount = 0 -- The internal counter of the amount of Moveing the has happened since MoveStart. self.MoveCount = 0 -- The internal counter of the amount of Moving the has happened since MoveStart.
self.MoveMaximum = MoveMaximum -- Contains the Maximum amount of units that are allowed to move... self.MoveMaximum = MoveMaximum -- Contains the Maximum amount of units that are allowed to move.
self.AliveUnits = 0 -- Contains the counter how many units are currently alive self.AliveUnits = 0 -- Contains the counter how many units are currently alive.
self.MoveUnits = {} -- Reflects if the Moving for this MovePrefixes is going to be scheduled or not. self.MoveUnits = {} -- Reflects if the Moving for this MovePrefixes is going to be scheduled or not.
self:HandleEvent( EVENTS.Birth ) self:HandleEvent( EVENTS.Birth )
-- self:AddEvent( world.event.S_EVENT_BIRTH, self.OnBirth ) -- self:AddEvent( world.event.S_EVENT_BIRTH, self.OnBirth )
-- --
-- self:EnableEvents() -- self:EnableEvents()
self:ScheduleStart() self:ScheduleStart()
return self return self
@@ -67,7 +67,7 @@ function MOVEMENT:ScheduleStop()
end end
--- Captures the birth events when new Units were spawned. --- Captures the birth events when new Units were spawned.
-- @todo This method should become obsolete. The new @{DATABASE} class will handle the collection administration. -- @todo This method should become obsolete. The global _DATABASE object (an instance of @{Core.Database#DATABASE}) will handle the collection administration.
-- @param #MOVEMENT self -- @param #MOVEMENT self
-- @param Core.Event#EVENTDATA self -- @param Core.Event#EVENTDATA self
function MOVEMENT:OnEventBirth( EventData ) function MOVEMENT:OnEventBirth( EventData )
@@ -86,14 +86,14 @@ function MOVEMENT:OnEventBirth( EventData )
end end
end end
end end
EventData.IniUnit:HandleEvent( EVENTS.DEAD, self.OnDeadOrCrash ) EventData.IniUnit:HandleEvent( EVENTS.DEAD, self.OnDeadOrCrash )
end end
end end
--- Captures the Dead or Crash events when Units crash or are destroyed. --- Captures the Dead or Crash events when Units crash or are destroyed.
-- @todo This method should become obsolete. The new @{DATABASE} class will handle the collection administration. -- @todo This method should become obsolete. The global _DATABASE object (an instance of @{Core.Database#DATABASE}) will handle the collection administration.
function MOVEMENT:OnDeadOrCrash( Event ) function MOVEMENT:OnDeadOrCrash( Event )
self:F( { Event } ) self:F( { Event } )
+1 -1
View File
@@ -5443,7 +5443,7 @@ function RAT:_ModifySpawnTemplate(waypoints, livery, spawnplace, departure, take
SpawnTemplate.units[UnitID]["onboard_num"] = string.format("%s%d%02d", self.onboardnum, (self.SpawnIndex-1)%10, (self.onboardnum0-1)+UnitID) SpawnTemplate.units[UnitID]["onboard_num"] = string.format("%s%d%02d", self.onboardnum, (self.SpawnIndex-1)%10, (self.onboardnum0-1)+UnitID)
end end
-- Modify coaltion and country of template. -- Modify coalition and country of template.
SpawnTemplate.CoalitionID=self.coalition SpawnTemplate.CoalitionID=self.coalition
if self.country then if self.country then
SpawnTemplate.CountryID=self.country SpawnTemplate.CountryID=self.country
+1 -1
View File
@@ -301,7 +301,7 @@
-- BASE:TraceLevel(1) -- BASE:TraceLevel(1)
-- BASE:TraceClass("RANGE") -- BASE:TraceClass("RANGE")
-- --
-- To get even more output you can increase the trace level to 2 or even 3, c.f. @{BASE} for more details. -- To get even more output you can increase the trace level to 2 or even 3, c.f. @{Core.Base#BASE} for more details.
-- --
-- The function @{#RANGE.DebugON}() can be used to send messages on screen. It also smokes all defined strafe and bombing targets, the strafe pit approach boxes and the range zone. -- The function @{#RANGE.DebugON}() can be used to send messages on screen. It also smokes all defined strafe and bombing targets, the strafe pit approach boxes and the range zone.
-- --
+12 -12
View File
@@ -59,7 +59,7 @@
-- --
-- ![Banner Image](..\Presentations\SCORING\Dia9.JPG) -- ![Banner Image](..\Presentations\SCORING\Dia9.JPG)
-- --
-- Various @{Zone}s can be defined for which scores are also granted when objects in that @{Zone} are destroyed. -- Various @{Core.Zone}s can be defined for which scores are also granted when objects in that @{Core.Zone} are destroyed.
-- This is **specifically useful** to designate **scenery targets on the map** that will generate points when destroyed. -- This is **specifically useful** to designate **scenery targets on the map** that will generate points when destroyed.
-- --
-- With a small change in MissionScripting.lua, the scoring results can also be logged in a **CSV file**. -- With a small change in MissionScripting.lua, the scoring results can also be logged in a **CSV file**.
@@ -131,11 +131,11 @@
-- # Define destruction zones that will give extra scores: -- # Define destruction zones that will give extra scores:
-- --
-- Define zones of destruction. Any object destroyed within the zone of the given category will give extra points. -- Define zones of destruction. Any object destroyed within the zone of the given category will give extra points.
-- Use the method @{#SCORING.AddZoneScore}() to add a @{Zone} for additional scoring. -- Use the method @{#SCORING.AddZoneScore}() to add a @{Core.Zone} for additional scoring.
-- Use the method @{#SCORING.RemoveZoneScore}() to remove a @{Zone} for additional scoring. -- Use the method @{#SCORING.RemoveZoneScore}() to remove a @{Core.Zone} for additional scoring.
-- There are interesting variations that can be achieved with this functionality. For example, if the @{Zone} is a @{Core.Zone#ZONE_UNIT}, -- There are interesting variations that can be achieved with this functionality. For example, if the @{Core.Zone} is a @{Core.Zone#ZONE_UNIT},
-- then the zone is a moving zone, and anything destroyed within that @{Zone} will generate points. -- then the zone is a moving zone, and anything destroyed within that @{Core.Zone} will generate points.
-- The other implementation could be to designate a scenery target (a building) in the mission editor surrounded by a @{Zone}, -- The other implementation could be to designate a scenery target (a building) in the mission editor surrounded by a @{Core.Zone},
-- just large enough around that building. -- just large enough around that building.
-- --
-- # Add extra Goal scores upon an event or a condition: -- # Add extra Goal scores upon an event or a condition:
@@ -419,11 +419,11 @@ function SCORING:AddScoreGroup( ScoreGroup, Score )
return self return self
end end
--- Add a @{Zone} to define additional scoring when any object is destroyed in that zone. --- Add a @{Core.Zone} to define additional scoring when any object is destroyed in that zone.
-- Note that if a @{Zone} with the same name is already within the scoring added, the @{Zone} (type) and Score will be replaced! -- Note that if a @{Core.Zone} with the same name is already within the scoring added, the @{Core.Zone} (type) and Score will be replaced!
-- This allows for a dynamic destruction zone evolution within your mission. -- This allows for a dynamic destruction zone evolution within your mission.
-- @param #SCORING self -- @param #SCORING self
-- @param Core.Zone#ZONE_BASE ScoreZone The @{Zone} which defines the destruction score perimeters. -- @param Core.Zone#ZONE_BASE ScoreZone The @{Core.Zone} which defines the destruction score perimeters.
-- Note that a zone can be a polygon or a moving zone. -- Note that a zone can be a polygon or a moving zone.
-- @param #number Score The Score value. -- @param #number Score The Score value.
-- @return #SCORING -- @return #SCORING
@@ -438,11 +438,11 @@ function SCORING:AddZoneScore( ScoreZone, Score )
return self return self
end end
--- Remove a @{Zone} for additional scoring. --- Remove a @{Core.Zone} for additional scoring.
-- The scoring will search if any @{Zone} is added with the given name, and will remove that zone from the scoring. -- The scoring will search if any @{Core.Zone} is added with the given name, and will remove that zone from the scoring.
-- This allows for a dynamic destruction zone evolution within your mission. -- This allows for a dynamic destruction zone evolution within your mission.
-- @param #SCORING self -- @param #SCORING self
-- @param Core.Zone#ZONE_BASE ScoreZone The @{Zone} which defines the destruction score perimeters. -- @param Core.Zone#ZONE_BASE ScoreZone The @{Core.Zone} which defines the destruction score perimeters.
-- Note that a zone can be a polygon or a moving zone. -- Note that a zone can be a polygon or a moving zone.
-- @return #SCORING -- @return #SCORING
function SCORING:RemoveZoneScore( ScoreZone ) function SCORING:RemoveZoneScore( ScoreZone )
@@ -6814,7 +6814,7 @@ function WAREHOUSE:_OnEventBaseCaptured(EventData)
self:AirbaseRecaptured(NewCoalitionAirbase) self:AirbaseRecaptured(NewCoalitionAirbase)
end end
else else
-- Captured airbase belongs to this warehouse but was captured by other coaltion. -- Captured airbase belongs to this warehouse but was captured by other coalition.
if NewCoalitionAirbase ~= self:GetCoalition() then if NewCoalitionAirbase ~= self:GetCoalition() then
self:AirbaseCaptured(NewCoalitionAirbase) self:AirbaseCaptured(NewCoalitionAirbase)
end end
@@ -7007,7 +7007,7 @@ function WAREHOUSE:_CheckRequestConsistancy(queue)
-- Request from enemy coalition? -- Request from enemy coalition?
if self:GetCoalition()~=request.warehouse:GetCoalition() then if self:GetCoalition()~=request.warehouse:GetCoalition() then
self:E(self.lid..string.format("ERROR: INVALID request. Requesting warehouse is of wrong coaltion! Own coalition %s != %s of requesting warehouse.", self:GetCoalitionName(), request.warehouse:GetCoalitionName())) self:E(self.lid..string.format("ERROR: INVALID request. Requesting warehouse is of wrong coalition! Own coalition %s != %s of requesting warehouse.", self:GetCoalitionName(), request.warehouse:GetCoalitionName()))
valid=false valid=false
end end
@@ -68,7 +68,7 @@ do -- ZONE_CAPTURE_COALITION
-- --
-- In order to use ZONE_CAPTURE_COALITION, you need to: -- In order to use ZONE_CAPTURE_COALITION, you need to:
-- --
-- * Create a @{Zone} object from one of the ZONE_ classes. -- * Create a @{Core.Zone} object from one of the ZONE_ classes.
-- The functional ZONE_ classses are those derived from a ZONE_RADIUS. -- The functional ZONE_ classses are those derived from a ZONE_RADIUS.
-- In order to use a ZONE_POLYGON, hand over the **GROUP name** of a late activated group forming a polygon with it's waypoints. -- In order to use a ZONE_POLYGON, hand over the **GROUP name** of a late activated group forming a polygon with it's waypoints.
-- * Set the state of the zone. Most of the time, Guarded would be the initial state. -- * Set the state of the zone. Most of the time, Guarded would be the initial state.
@@ -363,7 +363,7 @@ do -- ZONE_CAPTURE_COALITION
--- ZONE_CAPTURE_COALITION Constructor. --- ZONE_CAPTURE_COALITION Constructor.
-- @param #ZONE_CAPTURE_COALITION self -- @param #ZONE_CAPTURE_COALITION self
-- @param Core.Zone#ZONE Zone A @{Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{ZONE_POLYGON} with its waypoints. -- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{ZONE_POLYGON} with its waypoints.
-- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone. -- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone.
-- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. -- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
-- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS. -- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS.
+28 -35
View File
@@ -26,7 +26,6 @@ do -- Zone
-- @field #boolean SmokeZone If true, smoke zone. -- @field #boolean SmokeZone If true, smoke zone.
-- @extends Core.Zone#ZONE_RADIUS -- @extends Core.Zone#ZONE_RADIUS
--- Models processes that have a Goal with a defined achievement involving a Zone. --- Models processes that have a Goal with a defined achievement involving a Zone.
-- Derived classes implement the ways how the achievements can be realized. -- Derived classes implement the ways how the achievements can be realized.
-- --
@@ -53,18 +52,18 @@ do -- Zone
SmokeColor = nil, SmokeColor = nil,
SmokeZone = nil, SmokeZone = nil,
} }
--- ZONE_GOAL Constructor. --- ZONE_GOAL Constructor.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @param Core.Zone#ZONE_RADIUS Zone A @{Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{ZONE_POLYGON} with its waypoints. -- @param Core.Zone#ZONE_RADIUS Zone A @{Core.Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a ZONE_POLYGON with its waypoints.
-- @return #ZONE_GOAL -- @return #ZONE_GOAL
function ZONE_GOAL:New( Zone ) function ZONE_GOAL:New( Zone )
BASE:I({Zone=Zone}) BASE:I({Zone=Zone})
local self = BASE:Inherit( self, BASE:New()) local self = BASE:Inherit( self, BASE:New())
if type(Zone) == "string" then if type(Zone) == "string" then
self = BASE:Inherit( self, ZONE_POLYGON:NewFromGroupName(Zone) ) self = BASE:Inherit( self, ZONE_POLYGON:NewFromGroupName(Zone) )
else else
self = BASE:Inherit( self, ZONE_RADIUS:New( Zone:GetName(), Zone:GetVec2(), Zone:GetRadius() ) ) -- #ZONE_GOAL self = BASE:Inherit( self, ZONE_RADIUS:New( Zone:GetName(), Zone:GetVec2(), Zone:GetRadius() ) ) -- #ZONE_GOAL
self:F( { Zone = Zone } ) self:F( { Zone = Zone } )
end end
@@ -72,7 +71,7 @@ do -- Zone
self.Goal = GOAL:New() self.Goal = GOAL:New()
self.SmokeTime = nil self.SmokeTime = nil
-- Set smoke ON. -- Set smoke ON.
self:SetSmokeZone(true) self:SetSmokeZone(true)
@@ -86,7 +85,7 @@ do -- Zone
-- @function [parent=#ZONE_GOAL] __DestroyedUnit -- @function [parent=#ZONE_GOAL] __DestroyedUnit
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- DestroyedUnit Handler OnAfter for ZONE_GOAL --- DestroyedUnit Handler OnAfter for ZONE_GOAL
-- @function [parent=#ZONE_GOAL] OnAfterDestroyedUnit -- @function [parent=#ZONE_GOAL] OnAfterDestroyedUnit
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
@@ -98,15 +97,15 @@ do -- Zone
return self return self
end end
--- Get the Zone. --- Get the Zone.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @return #ZONE_GOAL -- @return #ZONE_GOAL
function ZONE_GOAL:GetZone() function ZONE_GOAL:GetZone()
return self return self
end end
--- Get the name of the Zone. --- Get the name of the Zone.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @return #string -- @return #string
@@ -114,7 +113,6 @@ do -- Zone
return self:GetName() return self:GetName()
end end
--- Activate smoking of zone with the color or the current owner. --- Activate smoking of zone with the color or the current owner.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @param #boolean switch If *true* or *nil* activate smoke. If *false* or *nil*, no smoke. -- @param #boolean switch If *true* or *nil* activate smoke. If *false* or *nil*, no smoke.
@@ -136,11 +134,10 @@ do -- Zone
-- @param DCS#SMOKECOLOR.Color SmokeColor -- @param DCS#SMOKECOLOR.Color SmokeColor
function ZONE_GOAL:Smoke( SmokeColor ) function ZONE_GOAL:Smoke( SmokeColor )
self:F( { SmokeColor = SmokeColor} ) self:F( { SmokeColor = SmokeColor} )
self.SmokeColor = SmokeColor self.SmokeColor = SmokeColor
end end
--- Flare the zone boundary. --- Flare the zone boundary.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @param DCS#SMOKECOLOR.Color FlareColor -- @param DCS#SMOKECOLOR.Color FlareColor
@@ -148,7 +145,6 @@ do -- Zone
self:FlareZone( FlareColor, 30) self:FlareZone( FlareColor, 30)
end end
--- When started, check the Smoke and the Zone status. --- When started, check the Smoke and the Zone status.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
function ZONE_GOAL:onafterGuard() function ZONE_GOAL:onafterGuard()
@@ -160,17 +156,16 @@ do -- Zone
end end
end end
--- Check status Smoke. --- Check status Smoke.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
function ZONE_GOAL:StatusSmoke() function ZONE_GOAL:StatusSmoke()
self:F({self.SmokeTime, self.SmokeColor}) self:F({self.SmokeTime, self.SmokeColor})
if self.SmokeZone then if self.SmokeZone then
-- Current time. -- Current time.
local CurrentTime = timer.getTime() local CurrentTime = timer.getTime()
-- Restart smoke every 5 min. -- Restart smoke every 5 min.
if self.SmokeTime == nil or self.SmokeTime + 300 <= CurrentTime then if self.SmokeTime == nil or self.SmokeTime + 300 <= CurrentTime then
if self.SmokeColor then if self.SmokeColor then
@@ -178,11 +173,10 @@ do -- Zone
self.SmokeTime = CurrentTime self.SmokeTime = CurrentTime
end end
end end
end
end
end
end
--- @param #ZONE_GOAL self --- @param #ZONE_GOAL self
-- @param Core.Event#EVENTDATA EventData Event data table. -- @param Core.Event#EVENTDATA EventData Event data table.
@@ -190,38 +184,37 @@ do -- Zone
self:F( { "EventDead", EventData } ) self:F( { "EventDead", EventData } )
self:F( { EventData.IniUnit } ) self:F( { EventData.IniUnit } )
if EventData.IniDCSUnit then if EventData.IniDCSUnit then
local Vec3 = EventData.IniDCSUnit:getPosition().p local Vec3 = EventData.IniDCSUnit:getPosition().p
self:F( { Vec3 = Vec3 } ) self:F( { Vec3 = Vec3 } )
if Vec3 and self:IsVec3InZone(Vec3) then if Vec3 and self:IsVec3InZone(Vec3) then
local PlayerHits = _DATABASE.HITS[EventData.IniUnitName] local PlayerHits = _DATABASE.HITS[EventData.IniUnitName]
if PlayerHits then if PlayerHits then
for PlayerName, PlayerHit in pairs( PlayerHits.Players or {} ) do for PlayerName, PlayerHit in pairs( PlayerHits.Players or {} ) do
self.Goal:AddPlayerContribution( PlayerName ) self.Goal:AddPlayerContribution( PlayerName )
self:DestroyedUnit( EventData.IniUnitName, PlayerName ) self:DestroyedUnit( EventData.IniUnitName, PlayerName )
end end
end end
end end
end end
end end
--- Activate the event UnitDestroyed to be fired when a unit is destroyed in the zone. --- Activate the event UnitDestroyed to be fired when a unit is destroyed in the zone.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
function ZONE_GOAL:MonitorDestroyedUnits() function ZONE_GOAL:MonitorDestroyedUnits()
self:HandleEvent( EVENTS.Dead, self.__Destroyed ) self:HandleEvent( EVENTS.Dead, self.__Destroyed )
self:HandleEvent( EVENTS.Crash, self.__Destroyed ) self:HandleEvent( EVENTS.Crash, self.__Destroyed )
end end
end end
@@ -55,7 +55,7 @@ do -- ZoneGoal
--- ZONE_GOAL_CARGO Constructor. --- ZONE_GOAL_CARGO Constructor.
-- @param #ZONE_GOAL_CARGO self -- @param #ZONE_GOAL_CARGO self
-- @param Core.Zone#ZONE Zone A @{Zone} object with the goal to be achieved. -- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved.
-- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone. -- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone.
-- @return #ZONE_GOAL_CARGO -- @return #ZONE_GOAL_CARGO
function ZONE_GOAL_CARGO:New( Zone, Coalition ) function ZONE_GOAL_CARGO:New( Zone, Coalition )
@@ -53,7 +53,7 @@ do -- ZoneGoal
--- ZONE_GOAL_COALITION Constructor. --- ZONE_GOAL_COALITION Constructor.
-- @param #ZONE_GOAL_COALITION self -- @param #ZONE_GOAL_COALITION self
-- @param Core.Zone#ZONE Zone A @{Zone} object with the goal to be achieved. -- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved.
-- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone. Default coalition.side.NEUTRAL. -- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone. Default coalition.side.NEUTRAL.
-- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. -- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}.
-- @return #ZONE_GOAL_COALITION -- @return #ZONE_GOAL_COALITION
+9 -9
View File
@@ -22,37 +22,37 @@ _DATABASE:_RegisterAirbases()
--- Check if os etc is available. --- Check if os etc is available.
BASE:I("Checking de-sanitization of os, io and lfs:") BASE:I("Checking de-sanitization of os, io and lfs:")
local __na=false local __na = false
if os then if os then
BASE:I("- os available") BASE:I("- os available")
else else
BASE:I("- os NOT available! Some functions may not work.") BASE:I("- os NOT available! Some functions may not work.")
__na=true __na = true
end end
if io then if io then
BASE:I("- io available") BASE:I("- io available")
else else
BASE:I("- io NOT available! Some functions may not work.") BASE:I("- io NOT available! Some functions may not work.")
__na=true __na = true
end end
if lfs then if lfs then
BASE:I("- lfs available") BASE:I("- lfs available")
else else
BASE:I("- lfs NOT available! Some functions may not work.") BASE:I("- lfs NOT available! Some functions may not work.")
__na=true __na = true
end end
if __na then if __na then
BASE:I("Check <DCS install folder>/Scripts/MissionScripting.lua and comment out the lines with sanitizeModule(''). Use at your own risk!)") BASE:I("Check <DCS install folder>/Scripts/MissionScripting.lua and comment out the lines with sanitizeModule(''). Use at your own risk!)")
end end
BASE.ServerName="Unknown" BASE.ServerName = "Unknown"
if lfs and loadfile then if lfs and loadfile then
local serverfile=lfs.writedir() .. 'Config/serverSettings.lua' local serverfile = lfs.writedir() .. 'Config/serverSettings.lua'
if UTILS.FileExists(serverfile) then if UTILS.FileExists(serverfile) then
loadfile(serverfile)() loadfile(serverfile)()
if cfg and cfg.name then if cfg and cfg.name then
BASE.ServerName=cfg.name BASE.ServerName = cfg.name
end end
end end
BASE.ServerName=BASE.ServerName or "Unknown" BASE.ServerName = BASE.ServerName or "Unknown"
BASE:I("Server Name: "..tostring(BASE.ServerName)) BASE:I("Server Name: " .. tostring(BASE.ServerName))
end end
+9 -9
View File
@@ -122,7 +122,7 @@
-- The @{#ATIS.New}(*airbasename*, *frequency*) creates a new ATIS object. The parameter *airbasename* is the name of the airbase or airport. Note that this has to be spelled exactly as in the DCS mission editor. -- The @{#ATIS.New}(*airbasename*, *frequency*) creates a new ATIS object. The parameter *airbasename* is the name of the airbase or airport. Note that this has to be spelled exactly as in the DCS mission editor.
-- The parameter *frequency* is the frequency the ATIS broadcasts in MHz. -- The parameter *frequency* is the frequency the ATIS broadcasts in MHz.
-- --
-- Broadcasting is started via the @{#ATIS.Start}() function. The start can be delayed by useing @{#ATIS.__Start}(*delay*), where *delay* is the delay in seconds. -- Broadcasting is started via the @{#ATIS.Start}() function. The start can be delayed by using @{#ATIS.__Start}(*delay*), where *delay* is the delay in seconds.
-- --
-- ## Subtitles -- ## Subtitles
-- --
@@ -1258,16 +1258,16 @@ function ATIS:onafterStart( From, Event, To )
-- Start radio queue. -- Start radio queue.
if not self.useSRS then if not self.useSRS then
self.radioqueue = RADIOQUEUE:New( self.frequency, self.modulation, string.format( "ATIS %s", self.airbasename ) ) self.radioqueue = RADIOQUEUE:New( self.frequency, self.modulation, string.format( "ATIS %s", self.airbasename ) )
-- Send coordinate is airbase coord. -- Send coordinate is airbase coord.
self.radioqueue:SetSenderCoordinate( self.airbase:GetCoordinate() ) self.radioqueue:SetSenderCoordinate( self.airbase:GetCoordinate() )
-- Set relay unit if we have one. -- Set relay unit if we have one.
self.radioqueue:SetSenderUnitName( self.relayunitname ) self.radioqueue:SetSenderUnitName( self.relayunitname )
-- Set radio power. -- Set radio power.
self.radioqueue:SetRadioPower( self.power ) self.radioqueue:SetRadioPower( self.power )
-- Init numbers. -- Init numbers.
self.radioqueue:SetDigit( 0, ATIS.Sound.N0.filename, ATIS.Sound.N0.duration, self.soundpath ) self.radioqueue:SetDigit( 0, ATIS.Sound.N0.filename, ATIS.Sound.N0.duration, self.soundpath )
self.radioqueue:SetDigit( 1, ATIS.Sound.N1.filename, ATIS.Sound.N1.duration, self.soundpath ) self.radioqueue:SetDigit( 1, ATIS.Sound.N1.filename, ATIS.Sound.N1.duration, self.soundpath )
@@ -1279,11 +1279,11 @@ function ATIS:onafterStart( From, Event, To )
self.radioqueue:SetDigit( 7, ATIS.Sound.N7.filename, ATIS.Sound.N7.duration, self.soundpath ) self.radioqueue:SetDigit( 7, ATIS.Sound.N7.filename, ATIS.Sound.N7.duration, self.soundpath )
self.radioqueue:SetDigit( 8, ATIS.Sound.N8.filename, ATIS.Sound.N8.duration, self.soundpath ) self.radioqueue:SetDigit( 8, ATIS.Sound.N8.filename, ATIS.Sound.N8.duration, self.soundpath )
self.radioqueue:SetDigit( 9, ATIS.Sound.N9.filename, ATIS.Sound.N9.duration, self.soundpath ) self.radioqueue:SetDigit( 9, ATIS.Sound.N9.filename, ATIS.Sound.N9.duration, self.soundpath )
-- Start radio queue. -- Start radio queue.
self.radioqueue:Start( 1, 0.1 ) self.radioqueue:Start( 1, 0.1 )
end end
-- Handle airbase capture -- Handle airbase capture
-- Handle events. -- Handle events.
self:HandleEvent( EVENTS.BaseCaptured ) self:HandleEvent( EVENTS.BaseCaptured )
@@ -1397,10 +1397,10 @@ function ATIS:onafterBroadcast( From, Event, To )
qnh = Q / 100 qnh = Q / 100
end end
local mBarqnh = qnh local mBarqnh = qnh
local mBarqfe = qfe local mBarqfe = qfe
-- Convert to inHg. -- Convert to inHg.
if self.PmmHg then if self.PmmHg then
qfe = UTILS.hPa2mmHg( qfe ) qfe = UTILS.hPa2mmHg( qfe )
+7 -7
View File
@@ -297,7 +297,7 @@
-- --
-- The flight that transitions form the holding pattern to the landing approach, it should leave the Marshal stack at the 3 position and make a left hand turn to the *Initial* -- The flight that transitions form the holding pattern to the landing approach, it should leave the Marshal stack at the 3 position and make a left hand turn to the *Initial*
-- position, which is 3 NM astern of the boat. Note that you need to be below 1300 feet to be registered in the initial zone. -- position, which is 3 NM astern of the boat. Note that you need to be below 1300 feet to be registered in the initial zone.
-- The altitude can be set via the function @{AIRBOSS.SetInitialMaxAlt}(*altitude*) function. -- The altitude can be set via the function @{#AIRBOSS.SetInitialMaxAlt}(*altitude*) function.
-- As described below, the initial zone can be smoked or flared via the AIRBOSS F10 Help radio menu. -- As described below, the initial zone can be smoked or flared via the AIRBOSS F10 Help radio menu.
-- --
-- ### Landing Pattern -- ### Landing Pattern
@@ -762,7 +762,7 @@
-- --
-- ## Save Results -- ## Save Results
-- --
-- Saving asset data to file is achieved by the @{AIRBOSS.Save}(*path*, *filename*) function. -- Saving asset data to file is achieved by the @{#AIRBOSS.Save}(*path*, *filename*) function.
-- --
-- The parameter *path* specifies the path on the file system where the -- The parameter *path* specifies the path on the file system where the
-- player grades are saved. If you do not specify a path, the file is saved your the DCS installation root directory if the **lfs** module is *not* desanizied or -- player grades are saved. If you do not specify a path, the file is saved your the DCS installation root directory if the **lfs** module is *not* desanizied or
@@ -783,7 +783,7 @@
-- --
-- ### Automatic Saving -- ### Automatic Saving
-- --
-- The player grades can be saved automatically after each graded player pass via the @{AIRBOSS.SetAutoSave}(*path*, *filename*) function. Again the parameters *path* and *filename* are optional. -- The player grades can be saved automatically after each graded player pass via the @{#AIRBOSS.SetAutoSave}(*path*, *filename*) function. Again the parameters *path* and *filename* are optional.
-- In the simplest case, you desanitize the **lfs** module and just add -- In the simplest case, you desanitize the **lfs** module and just add
-- --
-- airbossStennis:SetAutoSave() -- airbossStennis:SetAutoSave()
@@ -821,7 +821,7 @@
-- --
-- ## Load Results -- ## Load Results
-- --
-- Loading player grades from file is achieved by the @{AIRBOSS.Load}(*path*, *filename*) function. The parameter *path* specifies the path on the file system where the -- Loading player grades from file is achieved by the @{#AIRBOSS.Load}(*path*, *filename*) function. The parameter *path* specifies the path on the file system where the
-- data is loaded from. If you do not specify a path, the file is loaded from your the DCS installation root directory or, if **lfs** was desanitized from you "Saved Games\DCS" directory. -- data is loaded from. If you do not specify a path, the file is loaded from your the DCS installation root directory or, if **lfs** was desanitized from you "Saved Games\DCS" directory.
-- The parameter *filename* is optional and defines the name of the file to load. By default this is automatically generated from the AIBOSS carrier name/alias, for example -- The parameter *filename* is optional and defines the name of the file to load. By default this is automatically generated from the AIBOSS carrier name/alias, for example
-- "Airboss-USS Stennis_LSOgrades.csv". -- "Airboss-USS Stennis_LSOgrades.csv".
@@ -1041,7 +1041,7 @@
-- --
-- AI groups that enter the CCA are usually guided to Marshal stack. However, due to DCS limitations they might not obey the landing task if they have another airfield as departure and/or destination in -- AI groups that enter the CCA are usually guided to Marshal stack. However, due to DCS limitations they might not obey the landing task if they have another airfield as departure and/or destination in
-- their mission task. Therefore, AI groups can be respawned when detected in the CCA. This should clear all other airfields and allow the aircraft to land on the carrier. -- their mission task. Therefore, AI groups can be respawned when detected in the CCA. This should clear all other airfields and allow the aircraft to land on the carrier.
-- This is achieved by the @{AIRBOSS.SetRespawnAI}() function. -- This is achieved by the @{#AIRBOSS.SetRespawnAI}() function.
-- --
-- ## Known Issues -- ## Known Issues
-- --
@@ -10203,7 +10203,7 @@ function AIRBOSS:_GetWire( Lcoord, dc )
if self.Debug and false then if self.Debug and false then
-- Wire position coodinates. -- Wire position coordinates.
local wp1 = Scoord:Translate( w1, FB ) local wp1 = Scoord:Translate( w1, FB )
local wp2 = Scoord:Translate( w2, FB ) local wp2 = Scoord:Translate( w2, FB )
local wp3 = Scoord:Translate( w3, FB ) local wp3 = Scoord:Translate( w3, FB )
@@ -11391,7 +11391,7 @@ end
--- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway. --- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway.
-- @param #AIRBOSS self -- @param #AIRBOSS self
-- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned. -- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned.
-- @param Core.Point#COORDINATE coord (Optional) Coodinate from which heading is calculated. Default is current carrier position. -- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position.
-- @return #number Carrier heading in degrees. -- @return #number Carrier heading in degrees.
function AIRBOSS:GetHeadingIntoWind( magnetic, coord ) function AIRBOSS:GetHeadingIntoWind( magnetic, coord )
@@ -342,7 +342,7 @@ do -- DETECTION_REPORTING
return self return self
end end
--- Creates a string of the detected items in a @{Detection}. --- Creates a string of the detected items in a @{Functional.Detection} object.
-- @param #DETECTION_MANAGER self -- @param #DETECTION_MANAGER self
-- @param Core.Set#SET_UNIT DetectedSet The detected Set created by the @{Functional.Detection#DETECTION_BASE} object. -- @param Core.Set#SET_UNIT DetectedSet The detected Set created by the @{Functional.Detection#DETECTION_BASE} object.
-- @return #DETECTION_MANAGER self -- @return #DETECTION_MANAGER self
+20 -20
View File
@@ -86,7 +86,7 @@
-- - @{#MISSION.GetTasks}(): Retrieves a list of the tasks controlled by the mission. -- - @{#MISSION.GetTasks}(): Retrieves a list of the tasks controlled by the mission.
-- - @{#MISSION.GetTask}(): Retrieves a specific task controlled by the mission. -- - @{#MISSION.GetTask}(): Retrieves a specific task controlled by the mission.
-- - @{#MISSION.GetTasksRemaining}(): Retrieve a list of the tasks that aren't finished or failed, and are governed by the mission. -- - @{#MISSION.GetTasksRemaining}(): Retrieve a list of the tasks that aren't finished or failed, and are governed by the mission.
-- - @{#MISSION.GetGroupTasks}(): Retrieve a list of the tasks that can be asigned to a @{Wrapper.Group}. -- - @{#MISSION.GetGroupTasks}(): Retrieve a list of the tasks that can be assigned to a @{Wrapper.Group}.
-- - @{#MISSION.GetTaskTypes}(): Retrieve a list of the different task types governed by the mission. -- - @{#MISSION.GetTaskTypes}(): Retrieve a list of the different task types governed by the mission.
-- --
-- ### 3.3. Get the command center. -- ### 3.3. Get the command center.
@@ -131,7 +131,7 @@ MISSION = {
-- @param Tasking.CommandCenter#COMMANDCENTER CommandCenter -- @param Tasking.CommandCenter#COMMANDCENTER CommandCenter
-- @param #string MissionName Name of the mission. This name will be used to reference the status of each mission by the players. -- @param #string MissionName Name of the mission. This name will be used to reference the status of each mission by the players.
-- @param #string MissionPriority String indicating the "priority" of the Mission. e.g. "Primary", "Secondary". It is free format and up to the Mission designer to choose. There are no rules behind this field. -- @param #string MissionPriority String indicating the "priority" of the Mission. e.g. "Primary", "Secondary". It is free format and up to the Mission designer to choose. There are no rules behind this field.
-- @param #string MissionBriefing String indicating the mission briefing to be shown when a player joins a @{CLIENT}. -- @param #string MissionBriefing String indicating the mission briefing to be shown when a player joins a @{Wrapper.Client#CLIENT}.
-- @param DCS#coalition.side MissionCoalition Side of the coalition, i.e. and enumerator @{#DCS.coalition.side} corresponding to RED, BLUE or NEUTRAL. -- @param DCS#coalition.side MissionCoalition Side of the coalition, i.e. and enumerator @{#DCS.coalition.side} corresponding to RED, BLUE or NEUTRAL.
-- @return #MISSION self -- @return #MISSION self
function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition ) function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition )
@@ -543,7 +543,7 @@ end
do -- Group Assignment do -- Group Assignment
--- Returns if the @{Mission} is assigned to the Group. --- Returns if the @{Tasking.Mission} is assigned to the Group.
-- @param #MISSION self -- @param #MISSION self
-- @param Wrapper.Group#GROUP MissionGroup -- @param Wrapper.Group#GROUP MissionGroup
-- @return #boolean -- @return #boolean
@@ -561,7 +561,7 @@ do -- Group Assignment
end end
--- Set @{Wrapper.Group} assigned to the @{Mission}. --- Set @{Wrapper.Group} assigned to the @{Tasking.Mission}.
-- @param #MISSION self -- @param #MISSION self
-- @param Wrapper.Group#GROUP MissionGroup -- @param Wrapper.Group#GROUP MissionGroup
-- @return #MISSION -- @return #MISSION
@@ -576,7 +576,7 @@ do -- Group Assignment
return self return self
end end
--- Clear the @{Wrapper.Group} assignment from the @{Mission}. --- Clear the @{Wrapper.Group} assignment from the @{Tasking.Mission}.
-- @param #MISSION self -- @param #MISSION self
-- @param Wrapper.Group#GROUP MissionGroup -- @param Wrapper.Group#GROUP MissionGroup
-- @return #MISSION -- @return #MISSION
@@ -667,7 +667,7 @@ end
--- Get the TASK identified by the TaskNumber from the Mission. This function is useful in GoalFunctions. --- Get the TASK identified by the TaskNumber from the Mission. This function is useful in GoalFunctions.
-- @param #string TaskName The Name of the @{Task} within the @{Mission}. -- @param #string TaskName The Name of the @{Tasking.Task} within the @{Tasking.Mission}.
-- @return Tasking.Task#TASK The Task -- @return Tasking.Task#TASK The Task
-- @return #nil Returns nil if no task was found. -- @return #nil Returns nil if no task was found.
function MISSION:GetTask( TaskName ) function MISSION:GetTask( TaskName )
@@ -677,9 +677,9 @@ function MISSION:GetTask( TaskName )
end end
--- Return the next @{Task} ID to be completed within the @{Mission}. --- Return the next @{Tasking.Task} ID to be completed within the @{Tasking.Mission}.
-- @param #MISSION self -- @param #MISSION self
-- @param Tasking.Task#TASK Task is the @{Task} object. -- @param Tasking.Task#TASK Task is the @{Tasking.Task} object.
-- @return Tasking.Task#TASK The task added. -- @return Tasking.Task#TASK The task added.
function MISSION:GetNextTaskID( Task ) function MISSION:GetNextTaskID( Task )
@@ -689,11 +689,11 @@ function MISSION:GetNextTaskID( Task )
end end
--- Register a @{Task} to be completed within the @{Mission}. --- Register a @{Tasking.Task} to be completed within the @{Tasking.Mission}.
-- Note that there can be multiple @{Task}s registered to be completed. -- Note that there can be multiple @{Tasking.Task}s registered to be completed.
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached. -- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
-- @param #MISSION self -- @param #MISSION self
-- @param Tasking.Task#TASK Task is the @{Task} object. -- @param Tasking.Task#TASK Task is the @{Tasking.Task} object.
-- @return Tasking.Task#TASK The task added. -- @return Tasking.Task#TASK The task added.
function MISSION:AddTask( Task ) function MISSION:AddTask( Task )
@@ -708,11 +708,11 @@ function MISSION:AddTask( Task )
end end
--- Removes a @{Task} to be completed within the @{Mission}. --- Removes a @{Tasking.Task} to be completed within the @{Tasking.Mission}.
-- Note that there can be multiple @{Task}s registered to be completed. -- Note that there can be multiple @{Tasking.Task}s registered to be completed.
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached. -- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
-- @param #MISSION self -- @param #MISSION self
-- @param Tasking.Task#TASK Task is the @{Task} object. -- @param Tasking.Task#TASK Task is the @{Tasking.Task} object.
-- @return #nil The cleaned Task reference. -- @return #nil The cleaned Task reference.
function MISSION:RemoveTask( Task ) function MISSION:RemoveTask( Task )
@@ -733,35 +733,35 @@ function MISSION:RemoveTask( Task )
return nil return nil
end end
--- Is the @{Mission} **COMPLETED**. --- Is the @{Tasking.Mission} **COMPLETED**.
-- @param #MISSION self -- @param #MISSION self
-- @return #boolean -- @return #boolean
function MISSION:IsCOMPLETED() function MISSION:IsCOMPLETED()
return self:Is( "COMPLETED" ) return self:Is( "COMPLETED" )
end end
--- Is the @{Mission} **IDLE**. --- Is the @{Tasking.Mission} **IDLE**.
-- @param #MISSION self -- @param #MISSION self
-- @return #boolean -- @return #boolean
function MISSION:IsIDLE() function MISSION:IsIDLE()
return self:Is( "IDLE" ) return self:Is( "IDLE" )
end end
--- Is the @{Mission} **ENGAGED**. --- Is the @{Tasking.Mission} **ENGAGED**.
-- @param #MISSION self -- @param #MISSION self
-- @return #boolean -- @return #boolean
function MISSION:IsENGAGED() function MISSION:IsENGAGED()
return self:Is( "ENGAGED" ) return self:Is( "ENGAGED" )
end end
--- Is the @{Mission} **FAILED**. --- Is the @{Tasking.Mission} **FAILED**.
-- @param #MISSION self -- @param #MISSION self
-- @return #boolean -- @return #boolean
function MISSION:IsFAILED() function MISSION:IsFAILED()
return self:Is( "FAILED" ) return self:Is( "FAILED" )
end end
--- Is the @{Mission} **HOLD**. --- Is the @{Tasking.Mission} **HOLD**.
-- @param #MISSION self -- @param #MISSION self
-- @return #boolean -- @return #boolean
function MISSION:IsHOLD() function MISSION:IsHOLD()
@@ -1105,7 +1105,7 @@ function MISSION:ReportDetails( ReportGroup )
end end
--- Get all the TASKs from the Mission. This function is useful in GoalFunctions. --- Get all the TASKs from the Mission. This function is useful in GoalFunctions.
-- @return {TASK,...} Structure of TASKS with the @{TASK} number as the key. -- @return {TASK,...} Structure of TASKS with the @{Tasking.Task#TASK} number as the key.
-- @usage -- @usage
-- -- Get Tasks from the Mission. -- -- Get Tasks from the Mission.
-- Tasks = Mission:GetTasks() -- Tasks = Mission:GetTasks()
+53 -53
View File
@@ -38,7 +38,7 @@
-- --
-- A mission can be in a specific state during the simulation run. For more information about these states, please check the @{Tasking.Mission} section. -- A mission can be in a specific state during the simulation run. For more information about these states, please check the @{Tasking.Mission} section.
-- --
-- To achieve the mission goal, a mission administers @{Tasking.Task}s that are set to achieve the mission goal by the human players. -- To achieve the mission goal, a mission administers @{#TASK}s that are set to achieve the mission goal by the human players.
-- Each of these tasks can be **dynamically created** using a task dispatcher, or **coded** by the mission designer. -- Each of these tasks can be **dynamically created** using a task dispatcher, or **coded** by the mission designer.
-- Each mission has a separate **Mission Menu**, that focuses on the administration of these tasks. -- Each mission has a separate **Mission Menu**, that focuses on the administration of these tasks.
-- --
@@ -143,7 +143,7 @@
-- --
-- ![Command Center](../Tasking/Menu_CommandCenter.JPG) -- ![Command Center](../Tasking/Menu_CommandCenter.JPG)
-- --
-- When we take back the command center menu, you see two addtional **Assign Task** menu items. -- When we take back the command center menu, you see two additional **Assign Task** menu items.
-- The menu **Assign Task On** will automatically allocate a task to the player. -- The menu **Assign Task On** will automatically allocate a task to the player.
-- After the selection of this menu, the menu will change into **Assign Task Off**, -- After the selection of this menu, the menu will change into **Assign Task Off**,
-- and will need to be selected again by the player to switch of the automatic task assignment. -- and will need to be selected again by the player to switch of the automatic task assignment.
@@ -190,7 +190,7 @@
-- --
-- The state completion is by default set to **Success**, if the goals of the task have been reached, but can be overruled by a goal method. -- The state completion is by default set to **Success**, if the goals of the task have been reached, but can be overruled by a goal method.
-- --
-- Depending on the tactical situation, a task can be **Cancelled** by the mission governer. -- Depending on the tactical situation, a task can be **Cancelled** by the mission governor.
-- It is actually the mission designer who has the flexibility to decide at which conditions a task would be set to **Success**, **Failed** or **Cancelled**. -- It is actually the mission designer who has the flexibility to decide at which conditions a task would be set to **Success**, **Failed** or **Cancelled**.
-- This decision all depends on the task goals, and the phase/evolution of the task conditions that would accomplish the goals. -- This decision all depends on the task goals, and the phase/evolution of the task conditions that would accomplish the goals.
-- --
@@ -199,16 +199,16 @@
-- However, it could very well be also acceptable that the task would be flagged as **Success**. -- However, it could very well be also acceptable that the task would be flagged as **Success**.
-- --
-- The tasking mechanism governs beside the progress also a scoring mechanism, and in case of goal completion without any active pilot involved -- The tasking mechanism governs beside the progress also a scoring mechanism, and in case of goal completion without any active pilot involved
-- in the execution of the task, could result in a **Success** task completion status, but no score would be awared, as there were no players involved. -- in the execution of the task, could result in a **Success** task completion status, but no score would be awarded, as there were no players involved.
-- --
-- These different completion states are important for the mission designer to reflect scoring to a player. -- These different completion states are important for the mission designer to reflect scoring to a player.
-- A success could mean a positive score to be given, while a failure could mean a negative score or penalties to be awarded. -- A success could mean a positive score to be given, while a failure could mean a negative score or penalties to be awarded.
-- --
-- === -- ===
-- --
-- ### Author: **FlightControl** -- ### Author(s): **FlightControl**
-- --
-- ### Contributions: -- ### Contribution(s):
-- --
-- === -- ===
-- --
@@ -293,7 +293,7 @@
-- --
-- function Task:OnAfterGoal() -- function Task:OnAfterGoal()
-- if condition == true then -- if condition == true then
-- self:Success() -- This will flag the task to Succcess when the condition is true. -- self:Success() -- This will flag the task to Success when the condition is true.
-- else -- else
-- if condition2 == true and condition3 == true then -- if condition2 == true and condition3 == true then
-- self:Fail() -- This will flag the task to Failed, when condition2 and condition3 would be true. -- self:Fail() -- This will flag the task to Failed, when condition2 and condition3 would be true.
@@ -732,7 +732,7 @@ end
do -- Group Assignment do -- Group Assignment
--- Returns if the @{Task} is assigned to the Group. --- Returns if the @{#TASK} is assigned to the Group.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @return #boolean -- @return #boolean
@@ -750,7 +750,7 @@ do -- Group Assignment
end end
--- Set @{Wrapper.Group} assigned to the @{Task}. --- Set @{Wrapper.Group} assigned to the @{#TASK}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK -- @return #TASK
@@ -780,7 +780,7 @@ do -- Group Assignment
return self return self
end end
--- Clear the @{Wrapper.Group} assignment from the @{Task}. --- Clear the @{Wrapper.Group} assignment from the @{#TASK}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK -- @return #TASK
@@ -824,7 +824,7 @@ do -- Group Assignment
end end
--- Assign the @{Task} to a @{Wrapper.Group}. --- Assign the @{#TASK} to a @{Wrapper.Group}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @return #TASK -- @return #TASK
@@ -861,7 +861,7 @@ do -- Group Assignment
return self return self
end end
--- UnAssign the @{Task} from a @{Wrapper.Group}. --- UnAssign the @{#TASK} from a @{Wrapper.Group}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
function TASK:UnAssignFromGroup( TaskGroup ) function TASK:UnAssignFromGroup( TaskGroup )
@@ -899,7 +899,7 @@ function TASK:HasGroup( FindGroup )
end end
--- Assign the @{Task} to an alive @{Wrapper.Unit}. --- Assign the @{#TASK} to an alive @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK self -- @return #TASK self
@@ -918,7 +918,7 @@ function TASK:AssignToUnit( TaskUnit )
return self return self
end end
--- UnAssign the @{Task} from an alive @{Wrapper.Unit}. --- UnAssign the @{#TASK} from an alive @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK self -- @return #TASK self
@@ -932,7 +932,7 @@ function TASK:UnAssignFromUnit( TaskUnit )
return self return self
end end
--- Sets the TimeOut for the @{Task}. If @{Task} stayed planned for longer than TimeOut, it gets into Cancelled status. --- Sets the TimeOut for the @{#TASK}. If @{#TASK} stayed planned for longer than TimeOut, it gets into Cancelled status.
-- @param #TASK self -- @param #TASK self
-- @param #integer Timer in seconds -- @param #integer Timer in seconds
-- @return #TASK self -- @return #TASK self
@@ -943,7 +943,7 @@ function TASK:SetTimeOut ( Timer )
return self return self
end end
--- Send a message of the @{Task} to the assigned @{Wrapper.Group}s. --- Send a message of the @{#TASK} to the assigned @{Wrapper.Group}s.
-- @param #TASK self -- @param #TASK self
function TASK:MessageToGroups( Message ) function TASK:MessageToGroups( Message )
self:F( { Message = Message } ) self:F( { Message = Message } )
@@ -960,7 +960,7 @@ function TASK:MessageToGroups( Message )
end end
--- Send the briefng message of the @{Task} to the assigned @{Wrapper.Group}s. --- Send the briefing message of the @{#TASK} to the assigned @{Wrapper.Group}s.
-- @param #TASK self -- @param #TASK self
function TASK:SendBriefingToAssignedGroups() function TASK:SendBriefingToAssignedGroups()
self:F2() self:F2()
@@ -975,7 +975,7 @@ function TASK:SendBriefingToAssignedGroups()
end end
--- UnAssign the @{Task} from the @{Wrapper.Group}s. --- UnAssign the @{#TASK} from the @{Wrapper.Group}s.
-- @param #TASK self -- @param #TASK self
function TASK:UnAssignFromGroups() function TASK:UnAssignFromGroups()
self:F2() self:F2()
@@ -991,7 +991,7 @@ end
--- Returns if the @{Task} has still alive and assigned Units. --- Returns if the @{#TASK} has still alive and assigned Units.
-- @param #TASK self -- @param #TASK self
-- @return #boolean -- @return #boolean
function TASK:HasAliveUnits() function TASK:HasAliveUnits()
@@ -1016,7 +1016,7 @@ function TASK:HasAliveUnits()
return false return false
end end
--- Set the menu options of the @{Task} to all the groups in the SetGroup. --- Set the menu options of the @{#TASK} to all the groups in the SetGroup.
-- @param #TASK self -- @param #TASK self
-- @param #number MenuTime -- @param #number MenuTime
-- @return #TASK -- @return #TASK
@@ -1057,7 +1057,7 @@ function TASK:SetMenuForGroup( TaskGroup, MenuTime )
end end
--- Set the planned menu option of the @{Task}. --- Set the planned menu option of the @{#TASK}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @param #string MenuText The menu text. -- @param #string MenuText The menu text.
@@ -1092,7 +1092,7 @@ function TASK:SetPlannedMenuForGroup( TaskGroup, MenuTime )
return self return self
end end
--- Set the assigned menu options of the @{Task}. --- Set the assigned menu options of the @{#TASK}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @param #number MenuTime -- @param #number MenuTime
@@ -1127,7 +1127,7 @@ function TASK:SetAssignedMenuForGroup( TaskGroup, MenuTime )
return self return self
end end
--- Remove the menu options of the @{Task} to all the groups in the SetGroup. --- Remove the menu options of the @{#TASK} to all the groups in the SetGroup.
-- @param #TASK self -- @param #TASK self
-- @param #number MenuTime -- @param #number MenuTime
-- @return #TASK -- @return #TASK
@@ -1145,7 +1145,7 @@ function TASK:RemoveMenu( MenuTime )
end end
--- Remove the menu option of the @{Task} for a @{Wrapper.Group}. --- Remove the menu option of the @{#TASK} for a @{Wrapper.Group}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @param #number MenuTime -- @param #number MenuTime
@@ -1176,7 +1176,7 @@ function TASK:RefreshMenus( TaskGroup, MenuTime )
end end
--- Remove the assigned menu option of the @{Task} for a @{Wrapper.Group}. --- Remove the assigned menu option of the @{#TASK} for a @{Wrapper.Group}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Group#GROUP TaskGroup -- @param Wrapper.Group#GROUP TaskGroup
-- @param #number MenuTime -- @param #number MenuTime
@@ -1275,14 +1275,14 @@ end
--- Returns the @{Task} name. --- Returns the @{#TASK} name.
-- @param #TASK self -- @param #TASK self
-- @return #string TaskName -- @return #string TaskName
function TASK:GetTaskName() function TASK:GetTaskName()
return self.TaskName return self.TaskName
end end
--- Returns the @{Task} briefing. --- Returns the @{#TASK} briefing.
-- @param #TASK self -- @param #TASK self
-- @return #string Task briefing. -- @return #string Task briefing.
function TASK:GetTaskBriefing() function TASK:GetTaskBriefing()
@@ -1292,7 +1292,7 @@ end
--- Get the default or currently assigned @{Process} template with key ProcessName. --- Get the default or currently assigned @{Core.Fsm#FSM_PROCESS} template with key ProcessName.
-- @param #TASK self -- @param #TASK self
-- @param #string ProcessName -- @param #string ProcessName
-- @return Core.Fsm#FSM_PROCESS -- @return Core.Fsm#FSM_PROCESS
@@ -1305,8 +1305,8 @@ end
-- TODO: Obscolete? -- TODO: Obsolete?
--- Fail processes from @{Task} with key @{Wrapper.Unit} --- Fail processes from @{#TASK} with key @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param #string TaskUnitName -- @param #string TaskUnitName
-- @return #TASK self -- @return #TASK self
@@ -1318,7 +1318,7 @@ function TASK:FailProcesses( TaskUnitName )
end end
end end
--- Add a FiniteStateMachine to @{Task} with key Task@{Wrapper.Unit} --- Add a FiniteStateMachine to @{#TASK} with key @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @param Core.Fsm#FSM_PROCESS Fsm -- @param Core.Fsm#FSM_PROCESS Fsm
@@ -1331,7 +1331,7 @@ function TASK:SetStateMachine( TaskUnit, Fsm )
return Fsm return Fsm
end end
--- Gets the FiniteStateMachine of @{Task} with key Task@{Wrapper.Unit} --- Gets the FiniteStateMachine of @{#TASK} with key @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Fsm#FSM_PROCESS -- @return Core.Fsm#FSM_PROCESS
@@ -1341,7 +1341,7 @@ function TASK:GetStateMachine( TaskUnit )
return self.Fsm[TaskUnit] return self.Fsm[TaskUnit]
end end
--- Remove FiniteStateMachines from @{Task} with key Task@{Wrapper.Unit} --- Remove FiniteStateMachines from @{#TASK} with key @{Wrapper.Unit}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK self -- @return #TASK self
@@ -1365,7 +1365,7 @@ function TASK:RemoveStateMachine( TaskUnit )
end end
--- Checks if there is a FiniteStateMachine assigned to Task@{Wrapper.Unit} for @{Task} --- Checks if there is a FiniteStateMachine assigned to @{Wrapper.Unit} for @{#TASK}.
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK self -- @return #TASK self
@@ -1438,117 +1438,117 @@ function TASK:GetID()
end end
--- Sets a @{Task} to status **Success**. --- Sets a @{#TASK} to status **Success**.
-- @param #TASK self -- @param #TASK self
function TASK:StateSuccess() function TASK:StateSuccess()
self:SetState( self, "State", "Success" ) self:SetState( self, "State", "Success" )
return self return self
end end
--- Is the @{Task} status **Success**. --- Is the @{#TASK} status **Success**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateSuccess() function TASK:IsStateSuccess()
return self:Is( "Success" ) return self:Is( "Success" )
end end
--- Sets a @{Task} to status **Failed**. --- Sets a @{#TASK} to status **Failed**.
-- @param #TASK self -- @param #TASK self
function TASK:StateFailed() function TASK:StateFailed()
self:SetState( self, "State", "Failed" ) self:SetState( self, "State", "Failed" )
return self return self
end end
--- Is the @{Task} status **Failed**. --- Is the @{#TASK} status **Failed**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateFailed() function TASK:IsStateFailed()
return self:Is( "Failed" ) return self:Is( "Failed" )
end end
--- Sets a @{Task} to status **Planned**. --- Sets a @{#TASK} to status **Planned**.
-- @param #TASK self -- @param #TASK self
function TASK:StatePlanned() function TASK:StatePlanned()
self:SetState( self, "State", "Planned" ) self:SetState( self, "State", "Planned" )
return self return self
end end
--- Is the @{Task} status **Planned**. --- Is the @{#TASK} status **Planned**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStatePlanned() function TASK:IsStatePlanned()
return self:Is( "Planned" ) return self:Is( "Planned" )
end end
--- Sets a @{Task} to status **Aborted**. --- Sets a @{#TASK} to status **Aborted**.
-- @param #TASK self -- @param #TASK self
function TASK:StateAborted() function TASK:StateAborted()
self:SetState( self, "State", "Aborted" ) self:SetState( self, "State", "Aborted" )
return self return self
end end
--- Is the @{Task} status **Aborted**. --- Is the @{#TASK} status **Aborted**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateAborted() function TASK:IsStateAborted()
return self:Is( "Aborted" ) return self:Is( "Aborted" )
end end
--- Sets a @{Task} to status **Cancelled**. --- Sets a @{#TASK} to status **Cancelled**.
-- @param #TASK self -- @param #TASK self
function TASK:StateCancelled() function TASK:StateCancelled()
self:SetState( self, "State", "Cancelled" ) self:SetState( self, "State", "Cancelled" )
return self return self
end end
--- Is the @{Task} status **Cancelled**. --- Is the @{#TASK} status **Cancelled**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateCancelled() function TASK:IsStateCancelled()
return self:Is( "Cancelled" ) return self:Is( "Cancelled" )
end end
--- Sets a @{Task} to status **Assigned**. --- Sets a @{#TASK} to status **Assigned**.
-- @param #TASK self -- @param #TASK self
function TASK:StateAssigned() function TASK:StateAssigned()
self:SetState( self, "State", "Assigned" ) self:SetState( self, "State", "Assigned" )
return self return self
end end
--- Is the @{Task} status **Assigned**. --- Is the @{#TASK} status **Assigned**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateAssigned() function TASK:IsStateAssigned()
return self:Is( "Assigned" ) return self:Is( "Assigned" )
end end
--- Sets a @{Task} to status **Hold**. --- Sets a @{#TASK} to status **Hold**.
-- @param #TASK self -- @param #TASK self
function TASK:StateHold() function TASK:StateHold()
self:SetState( self, "State", "Hold" ) self:SetState( self, "State", "Hold" )
return self return self
end end
--- Is the @{Task} status **Hold**. --- Is the @{#TASK} status **Hold**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateHold() function TASK:IsStateHold()
return self:Is( "Hold" ) return self:Is( "Hold" )
end end
--- Sets a @{Task} to status **Replanned**. --- Sets a @{#TASK} to status **Replanned**.
-- @param #TASK self -- @param #TASK self
function TASK:StateReplanned() function TASK:StateReplanned()
self:SetState( self, "State", "Replanned" ) self:SetState( self, "State", "Replanned" )
return self return self
end end
--- Is the @{Task} status **Replanned**. --- Is the @{#TASK} status **Replanned**.
-- @param #TASK self -- @param #TASK self
function TASK:IsStateReplanned() function TASK:IsStateReplanned()
return self:Is( "Replanned" ) return self:Is( "Replanned" )
end end
--- Gets the @{Task} status. --- Gets the @{#TASK} status.
-- @param #TASK self -- @param #TASK self
function TASK:GetStateString() function TASK:GetStateString()
return self:GetState( self, "State" ) return self:GetState( self, "State" )
end end
--- Sets a @{Task} briefing. --- Sets a @{#TASK} briefing.
-- @param #TASK self -- @param #TASK self
-- @param #string TaskBriefing -- @param #string TaskBriefing
-- @return #TASK self -- @return #TASK self
@@ -1558,7 +1558,7 @@ function TASK:SetBriefing( TaskBriefing )
return self return self
end end
--- Gets the @{Task} briefing. --- Gets the @{#TASK} briefing.
-- @param #TASK self -- @param #TASK self
-- @return #string The briefing text. -- @return #string The briefing text.
function TASK:GetBriefing() function TASK:GetBriefing()
+1 -1
View File
@@ -18,7 +18,7 @@ do -- TASK_A2A
-- @field Core.Set#SET_UNIT TargetSetUnit -- @field Core.Set#SET_UNIT TargetSetUnit
-- @extends Tasking.Task#TASK -- @extends Tasking.Task#TASK
--- Defines Air To Air tasks for a @{Set} of Target Units, --- Defines Air To Air tasks for a @{Core.Set} of Target Units,
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}. -- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
-- The TASK_A2A is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses: -- The TASK_A2A is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses:
-- --
@@ -29,11 +29,11 @@ do -- TASK_A2A_DISPATCHER
-- @type TASK_A2A_DISPATCHER -- @type TASK_A2A_DISPATCHER
-- @extends Tasking.DetectionManager#DETECTION_MANAGER -- @extends Tasking.DetectionManager#DETECTION_MANAGER
--- Orchestrates the dynamic dispatching of tasks upon groups of detected units determined a @{Set} of EWR installation groups. --- Orchestrates the dynamic dispatching of tasks upon groups of detected units determined a @{Core.Set} of EWR installation groups.
-- --
-- ![Banner Image](..\Presentations\TASK_A2A_DISPATCHER\Dia3.JPG) -- ![Banner Image](..\Presentations\TASK_A2A_DISPATCHER\Dia3.JPG)
-- --
-- The EWR will detect units, will group them, and will dispatch @{Task}s to groups. Depending on the type of target detected, different tasks will be dispatched. -- The EWR will detect units, will group them, and will dispatch @{Tasking.Task}s to groups. Depending on the type of target detected, different tasks will be dispatched.
-- Find a summary below describing for which situation a task type is created: -- Find a summary below describing for which situation a task type is created:
-- --
-- ![Banner Image](..\Presentations\TASK_A2A_DISPATCHER\Dia9.JPG) -- ![Banner Image](..\Presentations\TASK_A2A_DISPATCHER\Dia9.JPG)
@@ -140,7 +140,7 @@ do -- TASK_A2A_DISPATCHER
-- --
-- ## 4. Set **Scoring** and **Messages**: -- ## 4. Set **Scoring** and **Messages**:
-- --
-- The TASK\_A2A\_DISPATCHER is a state machine. It triggers the event Assign when a new player joins a @{Task} dispatched by the TASK\_A2A\_DISPATCHER. -- The TASK\_A2A\_DISPATCHER is a state machine. It triggers the event Assign when a new player joins a @{Tasking.Task} dispatched by the TASK\_A2A\_DISPATCHER.
-- An _event handler_ can be defined to catch the **Assign** event, and add **additional processing** to set _scoring_ and to _define messages_, -- An _event handler_ can be defined to catch the **Assign** event, and add **additional processing** to set _scoring_ and to _define messages_,
-- when the player reaches certain achievements in the task. -- when the player reaches certain achievements in the task.
-- --
+1 -1
View File
@@ -18,7 +18,7 @@ do -- TASK_A2G
-- @field Core.Set#SET_UNIT TargetSetUnit -- @field Core.Set#SET_UNIT TargetSetUnit
-- @extends Tasking.Task#TASK -- @extends Tasking.Task#TASK
--- The TASK_A2G class defines Air To Ground tasks for a @{Set} of Target Units, --- The TASK_A2G class defines Air To Ground tasks for a @{Core.Set} of Target Units,
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}. -- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
-- The TASK_A2G is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses: -- The TASK_A2G is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses:
-- --
@@ -32,17 +32,17 @@ do -- TASK_A2G_DISPATCHER
-- @field Tasking.Mission#MISSION Mission -- @field Tasking.Mission#MISSION Mission
-- @extends Tasking.DetectionManager#DETECTION_MANAGER -- @extends Tasking.DetectionManager#DETECTION_MANAGER
--- Orchestrates dynamic **A2G Task Dispatching** based on the detection results of a linked @{Detection} object. --- Orchestrates dynamic **A2G Task Dispatching** based on the detection results of a linked @{Functional.Detection} object.
-- --
-- It uses the Tasking System within the MOOSE framework, which is a multi-player Tasking Orchestration system. -- It uses the Tasking System within the MOOSE framework, which is a multi-player Tasking Orchestration system.
-- It provides a truly dynamic battle environment for pilots and ground commanders to engage upon, -- It provides a truly dynamic battle environment for pilots and ground commanders to engage upon,
-- in a true co-operation environment wherein **Multiple Teams** will collaborate in Missions to **achieve a common Mission Goal**. -- in a true co-operation environment wherein **Multiple Teams** will collaborate in Missions to **achieve a common Mission Goal**.
-- --
-- The A2G dispatcher will dispatch the A2G Tasks to a defined @{Set} of @{Wrapper.Group}s that will be manned by **Players**. -- The A2G dispatcher will dispatch the A2G Tasks to a defined @{Core.Set} of @{Wrapper.Group}s that will be manned by **Players**.
-- We call this the **AttackSet** of the A2G dispatcher. So, the Players are seated in the @{Client}s of the @{Wrapper.Group} @{Set}. -- We call this the **AttackSet** of the A2G dispatcher. So, the Players are seated in the @{Wrapper.Client}s of the @{Wrapper.Group} @{Core.Set}.
-- --
-- Depending on the actions of the enemy, preventive tasks are dispatched to the players to orchestrate the engagement in a true co-operation. -- Depending on the actions of the enemy, preventive tasks are dispatched to the players to orchestrate the engagement in a true co-operation.
-- The detection object will group the detected targets by its grouping method, and integrates a @{Set} of @{Wrapper.Group}s that are Recce vehicles or air units. -- The detection object will group the detected targets by its grouping method, and integrates a @{Core.Set} of @{Wrapper.Group}s that are Recce vehicles or air units.
-- We call this the **RecceSet** of the A2G dispatcher. -- We call this the **RecceSet** of the A2G dispatcher.
-- --
-- Depending on the current detected tactical situation, different task types will be dispatched to the Players seated in the AttackSet.. -- Depending on the current detected tactical situation, different task types will be dispatched to the Players seated in the AttackSet..
@@ -108,7 +108,7 @@ do -- TASK_A2G_DISPATCHER
-- --
-- # 1. Player Experience -- # 1. Player Experience
-- --
-- The A2G dispatcher is residing under a @{CommandCenter}, which is orchestrating a @{Mission}. -- The A2G dispatcher is residing under a @{Tasking.CommandCenter}, which is orchestrating a @{Tasking.Mission}.
-- As a result, you'll find for DCS World missions that implement the A2G dispatcher a **Command Center Menu** and under this one or more **Mission Menus**. -- As a result, you'll find for DCS World missions that implement the A2G dispatcher a **Command Center Menu** and under this one or more **Mission Menus**.
-- --
-- For example, if there are 2 Command Centers (CC). -- For example, if there are 2 Command Centers (CC).
@@ -384,12 +384,12 @@ do -- TASK_A2G_DISPATCHER
-- --
-- To use the TASK\_A2G\_DISPATCHER class, you need: -- To use the TASK\_A2G\_DISPATCHER class, you need:
-- --
-- - A @{CommandCenter} object. The master communication channel. -- - A @{Tasking.CommandCenter} object. The master communication channel.
-- - A @{Mission} object. Each task belongs to a Mission. -- - A @{Tasking.Mission} object. Each task belongs to a Mission.
-- - A @{Detection} object. There are several detection grouping methods to choose from. -- - A @{Functional.Detection} object. There are several detection grouping methods to choose from.
-- - A @{Task_A2G_Dispatcher} object. The master A2G task dispatcher. -- - A @{Tasking.Task_A2G_Dispatcher} object. The master A2G task dispatcher.
-- - A @{Set} of @{Wrapper.Group} objects that will detect the enemy, the RecceSet. This is attached to the @{Detection} object. -- - A @{Core.Set} of @{Wrapper.Group} objects that will detect the enemy, the RecceSet. This is attached to the @{Functional.Detection} object.
-- - A @{Set} ob @{Wrapper.Group} objects that will attack the enemy, the AttackSet. This is attached to the @{Task_A2G_Dispatcher} object. -- - A @{Core.Set} of @{Wrapper.Group} objects that will attack the enemy, the AttackSet. This is attached to the @{Tasking.Task_A2G_Dispatcher} object.
-- --
-- Below an example mission declaration that is defines a Task A2G Dispatcher object. -- Below an example mission declaration that is defines a Task A2G Dispatcher object.
-- --
@@ -33,7 +33,7 @@
-- @image MOOSE.JPG -- @image MOOSE.JPG
do -- TASK_MANAGER do -- TASK_MANAGER
--- TASK_MANAGER class. --- TASK_MANAGER class.
-- @type TASK_MANAGER -- @type TASK_MANAGER
-- @field Core.Set#SET_GROUP SetGroup The set of group objects containing players for which tasks are managed. -- @field Core.Set#SET_GROUP SetGroup The set of group objects containing players for which tasks are managed.
@@ -42,21 +42,21 @@ do -- TASK_MANAGER
ClassName = "TASK_MANAGER", ClassName = "TASK_MANAGER",
SetGroup = nil, SetGroup = nil,
} }
--- TASK\_MANAGER constructor. --- TASK\_MANAGER constructor.
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param Core.Set#SET_GROUP SetGroup The set of group objects containing players for which tasks are managed. -- @param Core.Set#SET_GROUP SetGroup The set of group objects containing players for which tasks are managed.
-- @return #TASK_MANAGER self -- @return #TASK_MANAGER self
function TASK_MANAGER:New( SetGroup ) function TASK_MANAGER:New( SetGroup )
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, FSM:New() ) -- #TASK_MANAGER local self = BASE:Inherit( self, FSM:New() ) -- #TASK_MANAGER
self.SetGroup = SetGroup self.SetGroup = SetGroup
self:SetStartState( "Stopped" ) self:SetStartState( "Stopped" )
self:AddTransition( "Stopped", "StartTasks", "Started" ) self:AddTransition( "Stopped", "StartTasks", "Started" )
--- StartTasks Handler OnBefore for TASK_MANAGER --- StartTasks Handler OnBefore for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnBeforeStartTasks -- @function [parent=#TASK_MANAGER] OnBeforeStartTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -64,27 +64,25 @@ do -- TASK_MANAGER
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
-- @return #boolean -- @return #boolean
--- StartTasks Handler OnAfter for TASK_MANAGER --- StartTasks Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterStartTasks -- @function [parent=#TASK_MANAGER] OnAfterStartTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param #string From -- @param #string From
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
--- StartTasks Trigger for TASK_MANAGER --- StartTasks Trigger for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] StartTasks -- @function [parent=#TASK_MANAGER] StartTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
--- StartTasks Asynchronous Trigger for TASK_MANAGER --- StartTasks Asynchronous Trigger for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] __StartTasks -- @function [parent=#TASK_MANAGER] __StartTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param #number Delay -- @param #number Delay
self:AddTransition( "Started", "StopTasks", "Stopped" ) self:AddTransition( "Started", "StopTasks", "Stopped" )
--- StopTasks Handler OnBefore for TASK_MANAGER --- StopTasks Handler OnBefore for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnBeforeStopTasks -- @function [parent=#TASK_MANAGER] OnBeforeStopTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -92,28 +90,27 @@ do -- TASK_MANAGER
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
-- @return #boolean -- @return #boolean
--- StopTasks Handler OnAfter for TASK_MANAGER --- StopTasks Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterStopTasks -- @function [parent=#TASK_MANAGER] OnAfterStopTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param #string From -- @param #string From
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
--- StopTasks Trigger for TASK_MANAGER --- StopTasks Trigger for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] StopTasks -- @function [parent=#TASK_MANAGER] StopTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
--- StopTasks Asynchronous Trigger for TASK_MANAGER --- StopTasks Asynchronous Trigger for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] __StopTasks -- @function [parent=#TASK_MANAGER] __StopTasks
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param #number Delay -- @param #number Delay
self:AddTransition( "Started", "Manage", "Started" ) self:AddTransition( "Started", "Manage", "Started" )
self:AddTransition( "Started", "Success", "Started" ) self:AddTransition( "Started", "Success", "Started" )
--- Success Handler OnAfter for TASK_MANAGER --- Success Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterSuccess -- @function [parent=#TASK_MANAGER] OnAfterSuccess
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -121,10 +118,9 @@ do -- TASK_MANAGER
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
-- @param Tasking.Task#TASK Task -- @param Tasking.Task#TASK Task
self:AddTransition( "Started", "Failed", "Started" ) self:AddTransition( "Started", "Failed", "Started" )
--- Failed Handler OnAfter for TASK_MANAGER --- Failed Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterFailed -- @function [parent=#TASK_MANAGER] OnAfterFailed
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -132,10 +128,9 @@ do -- TASK_MANAGER
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
-- @param Tasking.Task#TASK Task -- @param Tasking.Task#TASK Task
self:AddTransition( "Started", "Aborted", "Started" ) self:AddTransition( "Started", "Aborted", "Started" )
--- Aborted Handler OnAfter for TASK_MANAGER --- Aborted Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterAborted -- @function [parent=#TASK_MANAGER] OnAfterAborted
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -143,9 +138,9 @@ do -- TASK_MANAGER
-- @param #string Event -- @param #string Event
-- @param #string To -- @param #string To
-- @param Tasking.Task#TASK Task -- @param Tasking.Task#TASK Task
self:AddTransition( "Started", "Cancelled", "Started" ) self:AddTransition( "Started", "Cancelled", "Started" )
--- Cancelled Handler OnAfter for TASK_MANAGER --- Cancelled Handler OnAfter for TASK_MANAGER
-- @function [parent=#TASK_MANAGER] OnAfterCancelled -- @function [parent=#TASK_MANAGER] OnAfterCancelled
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
@@ -155,37 +150,37 @@ do -- TASK_MANAGER
-- @param Tasking.Task#TASK Task -- @param Tasking.Task#TASK Task
self:SetRefreshTimeInterval( 30 ) self:SetRefreshTimeInterval( 30 )
return self return self
end end
function TASK_MANAGER:onafterStartTasks( From, Event, To ) function TASK_MANAGER:onafterStartTasks( From, Event, To )
self:Manage() self:Manage()
end end
function TASK_MANAGER:onafterManage( From, Event, To ) function TASK_MANAGER:onafterManage( From, Event, To )
self:__Manage( -self._RefreshTimeInterval ) self:__Manage( -self._RefreshTimeInterval )
self:ManageTasks() self:ManageTasks()
end end
--- Set the refresh time interval in seconds when a new task management action needs to be done. --- Set the refresh time interval in seconds when a new task management action needs to be done.
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @param #number RefreshTimeInterval The refresh time interval in seconds when a new task management action needs to be done. -- @param #number RefreshTimeInterval The refresh time interval in seconds when a new task management action needs to be done.
-- @return #TASK_MANAGER self -- @return #TASK_MANAGER self
function TASK_MANAGER:SetRefreshTimeInterval( RefreshTimeInterval ) function TASK_MANAGER:SetRefreshTimeInterval( RefreshTimeInterval )
self:F2() self:F2()
self._RefreshTimeInterval = RefreshTimeInterval self._RefreshTimeInterval = RefreshTimeInterval
end end
--- Manages the tasks for the @{Core.Set#SET_GROUP}. --- Manages the tasks for the @{Core.Set#SET_GROUP}.
-- @param #TASK_MANAGER self -- @param #TASK_MANAGER self
-- @return #TASK_MANAGER self -- @return #TASK_MANAGER self
function TASK_MANAGER:ManageTasks() function TASK_MANAGER:ManageTasks()
end end
end end
+1 -1
View File
@@ -1421,7 +1421,7 @@ function UTILS.CheckMemory(output)
end end
--- Get the coalition name from its numerical ID, e.g. coaliton.side.RED. --- Get the coalition name from its numerical ID, e.g. coalition.side.RED.
-- @param #number Coalition The coalition ID. -- @param #number Coalition The coalition ID.
-- @return #string The coalition name, i.e. "Neutral", "Red" or "Blue" (or "Unknown"). -- @return #string The coalition name, i.e. "Neutral", "Red" or "Blue" (or "Unknown").
function UTILS.GetCoalitionName(Coalition) function UTILS.GetCoalitionName(Coalition)
+3 -3
View File
@@ -39,7 +39,7 @@
-- --
-- ## AIRBASE reference methods -- ## AIRBASE reference methods
-- --
-- For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the _@{DATABASE} object. -- For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- This is done at the beginning of the mission (when the mission starts). -- This is done at the beginning of the mission (when the mission starts).
-- --
-- The AIRBASE class **does not contain a :New()** method, rather it provides **:Find()** methods to retrieve the object reference -- The AIRBASE class **does not contain a :New()** method, rather it provides **:Find()** methods to retrieve the object reference
@@ -51,8 +51,8 @@
-- --
-- The AIRBASE class provides the following functions to retrieve quickly the relevant AIRBASE instance: -- The AIRBASE class provides the following functions to retrieve quickly the relevant AIRBASE instance:
-- --
-- * @{#AIRBASE.Find}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase object. -- * @{#AIRBASE.Find}(): Find a AIRBASE instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Airbase object.
-- * @{#AIRBASE.FindByName}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase name. -- * @{#AIRBASE.FindByName}(): Find a AIRBASE instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Airbase name.
-- --
-- IMPORTANT: ONE SHOULD NEVER SANITIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil). -- IMPORTANT: ONE SHOULD NEVER SANITIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil).
-- --
+4 -4
View File
@@ -39,11 +39,11 @@
-- * Handles messages to players. -- * Handles messages to players.
-- * Manage the "state" of the DCS Unit. -- * Manage the "state" of the DCS Unit.
-- --
-- Clients are being used by the @{MISSION} class to follow players and register their successes. -- Clients are being used by the @{Tasking.Mission#MISSION} class to follow players and register their successes.
-- --
-- ## CLIENT reference methods -- ## CLIENT reference methods
-- --
-- For each DCS Unit having skill level Player or Client, a CLIENT wrapper object (instance) will be created within the _@{DATABASE} object. -- For each DCS Unit having skill level Player or Client, a CLIENT wrapper object (instance) will be created within the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- This is done at the beginning of the mission (when the mission starts). -- This is done at the beginning of the mission (when the mission starts).
-- --
-- The CLIENT class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference -- The CLIENT class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
@@ -55,8 +55,8 @@
-- --
-- The CLIENT class provides the following functions to retrieve quickly the relevant CLIENT instance: -- The CLIENT class provides the following functions to retrieve quickly the relevant CLIENT instance:
-- --
-- * @{#CLIENT.Find}(): Find a CLIENT instance from the _DATABASE object using a DCS Unit object. -- * @{#CLIENT.Find}(): Find a CLIENT instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Unit object.
-- * @{#CLIENT.FindByName}(): Find a CLIENT instance from the _DATABASE object using a DCS Unit name. -- * @{#CLIENT.FindByName}(): Find a CLIENT instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Unit name.
-- --
-- **IMPORTANT: ONE SHOULD NEVER SANITIZE these CLIENT OBJECT REFERENCES! (make the CLIENT object references nil).** -- **IMPORTANT: ONE SHOULD NEVER SANITIZE these CLIENT OBJECT REFERENCES! (make the CLIENT object references nil).**
-- --
@@ -3635,7 +3635,7 @@ end
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan. --- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
-- Use the method @{#CONTROLLABLE.WayPointFunction}() to define the hook functions for specific waypoints. -- Use the method @{#CONTROLLABLE.WayPointFunction}() to define the hook functions for specific waypoints.
-- Use the method @{#CONTROLLABLE.WayPointExecute)() to start the execution of the new mission plan. -- Use the method @{#CONTROLLABLE.WayPointExecute}() to start the execution of the new mission plan.
-- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED! -- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED!
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param #table WayPoints If WayPoints is given, then use the route. -- @param #table WayPoints If WayPoints is given, then use the route.
+24 -24
View File
@@ -15,8 +15,8 @@
-- --
-- === -- ===
-- --
-- For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _@{DATABASE} object. -- For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the @{SPAWN} class). -- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the @{Core.Spawn} class).
-- --
-- The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference -- The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
-- using the DCS Group or the DCS GroupName. -- using the DCS Group or the DCS GroupName.
@@ -47,8 +47,8 @@
-- --
-- The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance: -- The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:
-- --
-- * @{#GROUP.Find}(): Find a GROUP instance from the _DATABASE object using a DCS Group object. -- * @{#GROUP.Find}(): Find a GROUP instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Group object.
-- * @{#GROUP.FindByName}(): Find a GROUP instance from the _DATABASE object using a DCS Group name. -- * @{#GROUP.FindByName}(): Find a GROUP instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Group name.
-- --
-- # 1. Tasking of groups -- # 1. Tasking of groups
-- --
@@ -132,14 +132,14 @@
-- --
-- ## GROUP Zone validation methods -- ## GROUP Zone validation methods
-- --
-- The group can be validated whether it is completely, partly or not within a @{Zone}. -- The group can be validated whether it is completely, partly or not within a @{Core.Zone}.
-- Use the following Zone validation methods on the group: -- Use the following Zone validation methods on the group:
-- --
-- * @{#GROUP.IsCompletelyInZone}: Returns true if all units of the group are within a @{Zone}. -- * @{#GROUP.IsCompletelyInZone}: Returns true if all units of the group are within a @{Core.Zone}.
-- * @{#GROUP.IsPartlyInZone}: Returns true if some units of the group are within a @{Zone}. -- * @{#GROUP.IsPartlyInZone}: Returns true if some units of the group are within a @{Core.Zone}.
-- * @{#GROUP.IsNotInZone}: Returns true if none of the group units of the group are within a @{Zone}. -- * @{#GROUP.IsNotInZone}: Returns true if none of the group units of the group are within a @{Core.Zone}.
-- --
-- The zone can be of any @{Zone} class derived from @{Core.Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on. -- The zone can be of any @{Core.Zone} class derived from @{Core.Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
-- --
-- ## GROUP AI methods -- ## GROUP AI methods
-- --
@@ -1295,7 +1295,7 @@ end
do -- Is Zone methods do -- Is Zone methods
--- Check if any unit of a group is inside a @{Zone}. --- Check if any unit of a group is inside a @{Core.Zone}.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns `true` if *at least one unit* is inside the zone or `false` if *no* unit is inside. -- @return #boolean Returns `true` if *at least one unit* is inside the zone or `false` if *no* unit is inside.
@@ -1324,7 +1324,7 @@ function GROUP:IsInZone( Zone )
return nil return nil
end end
--- Returns true if all units of the group are within a @{Zone}. --- Returns true if all units of the group are within a @{Core.Zone}.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE} -- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
@@ -1344,7 +1344,7 @@ function GROUP:IsCompletelyInZone( Zone )
return true return true
end end
--- Returns true if some but NOT ALL units of the group are within a @{Zone}. --- Returns true if some but NOT ALL units of the group are within a @{Core.Zone}.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the Group is partially within the @{Core.Zone#ZONE_BASE} -- @return #boolean Returns true if the Group is partially within the @{Core.Zone#ZONE_BASE}
@@ -1372,7 +1372,7 @@ function GROUP:IsPartlyInZone( Zone )
end end
end end
--- Returns true if part or all units of the group are within a @{Zone}. --- Returns true if part or all units of the group are within a @{Core.Zone}.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the Group is partially or completely within the @{Core.Zone#ZONE_BASE}. -- @return #boolean Returns true if the Group is partially or completely within the @{Core.Zone#ZONE_BASE}.
@@ -1380,7 +1380,7 @@ function GROUP:IsPartlyOrCompletelyInZone( Zone )
return self:IsPartlyInZone(Zone) or self:IsCompletelyInZone(Zone) return self:IsPartlyInZone(Zone) or self:IsCompletelyInZone(Zone)
end end
--- Returns true if none of the group units of the group are within a @{Zone}. --- Returns true if none of the group units of the group are within a @{Core.Zone}.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the Group is not within the @{Core.Zone#ZONE_BASE} -- @return #boolean Returns true if the Group is not within the @{Core.Zone#ZONE_BASE}
@@ -1416,10 +1416,10 @@ function GROUP:IsAnyInZone( Zone )
return false return false
end end
--- Returns the number of UNITs that are in the @{Zone} --- Returns the number of UNITs that are in the @{Core.Zone}
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #number The number of UNITs that are in the @{Zone} -- @return #number The number of UNITs that are in the @{Core.Zone}
function GROUP:CountInZone( Zone ) function GROUP:CountInZone( Zone )
self:F2( {self.GroupName, Zone} ) self:F2( {self.GroupName, Zone} )
local Count = 0 local Count = 0
@@ -1676,7 +1676,7 @@ end
-- RESPAWNING -- RESPAWNING
--- Returns the group template from the @{DATABASE} (_DATABASE object). --- Returns the group template from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- @param #GROUP self -- @param #GROUP self
-- @return #table -- @return #table
function GROUP:GetTemplate() function GROUP:GetTemplate()
@@ -1684,7 +1684,7 @@ function GROUP:GetTemplate()
return UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ) ) return UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ) )
end end
--- Returns the group template route.points[] (the waypoints) from the @{DATABASE} (_DATABASE object). --- Returns the group template route.points[] (the waypoints) from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- @param #GROUP self -- @param #GROUP self
-- @return #table -- @return #table
function GROUP:GetTemplateRoutePoints() function GROUP:GetTemplateRoutePoints()
@@ -1742,7 +1742,7 @@ function GROUP:InitHeight( Height )
end end
--- Set the respawn @{Zone} for the respawned group. --- Set the respawn @{Core.Zone} for the respawned group.
-- @param #GROUP self -- @param #GROUP self
-- @param Core.Zone#ZONE Zone The zone in meters. -- @param Core.Zone#ZONE Zone The zone in meters.
-- @return #GROUP self -- @return #GROUP self
@@ -1752,7 +1752,7 @@ function GROUP:InitZone( Zone )
end end
--- Randomize the positions of the units of the respawned group within the @{Zone}. --- Randomize the positions of the units of the respawned group within the @{Core.Zone}.
-- When a Respawn happens, the units of the group will be placed at random positions within the Zone (selected). -- When a Respawn happens, the units of the group will be placed at random positions within the Zone (selected).
-- @param #GROUP self -- @param #GROUP self
-- @param #boolean PositionZone true will randomize the positions within the Zone. -- @param #boolean PositionZone true will randomize the positions within the Zone.
@@ -1852,9 +1852,9 @@ end
-- - @{#GROUP.InitHeading}: Set the heading for the units in degrees within the respawned group. -- - @{#GROUP.InitHeading}: Set the heading for the units in degrees within the respawned group.
-- - @{#GROUP.InitHeight}: Set the height for the units in meters for the respawned group. (This is applicable for air units). -- - @{#GROUP.InitHeight}: Set the height for the units in meters for the respawned group. (This is applicable for air units).
-- - @{#GROUP.InitRandomizeHeading}: Randomize the headings for the units within the respawned group. -- - @{#GROUP.InitRandomizeHeading}: Randomize the headings for the units within the respawned group.
-- - @{#GROUP.InitZone}: Set the respawn @{Zone} for the respawned group. -- - @{#GROUP.InitZone}: Set the respawn @{Core.Zone} for the respawned group.
-- - @{#GROUP.InitRandomizeZones}: Randomize the respawn @{Zone} between one of the @{Zone}s given for the respawned group. -- - @{#GROUP.InitRandomizeZones}: Randomize the respawn @{Core.Zone} between one of the @{Core.Zone}s given for the respawned group.
-- - @{#GROUP.InitRandomizePositionZone}: Randomize the positions of the units of the respawned group within the @{Zone}. -- - @{#GROUP.InitRandomizePositionZone}: Randomize the positions of the units of the respawned group within the @{Core.Zone}.
-- - @{#GROUP.InitRandomizePositionRadius}: Randomize the positions of the units of the respawned group in a circle band. -- - @{#GROUP.InitRandomizePositionRadius}: Randomize the positions of the units of the respawned group in a circle band.
-- - @{#GROUP.InitRandomizeTemplates}: Randomize the Template for the respawned group. -- - @{#GROUP.InitRandomizeTemplates}: Randomize the Template for the respawned group.
-- --
@@ -2205,7 +2205,7 @@ function GROUP:GetTaskRoute()
return routines.utils.deepCopy( _DATABASE.Templates.Groups[self.GroupName].Template.route.points ) return routines.utils.deepCopy( _DATABASE.Templates.Groups[self.GroupName].Template.route.points )
end end
--- Return the route of a group by using the @{Core.Database#DATABASE} class. --- Return the route of a group by using the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- @param #GROUP self -- @param #GROUP self
-- @param #number Begin The route point from where the copy will start. The base route point is 0. -- @param #number Begin The route point from where the copy will start. The base route point is 0.
-- @param #number End The route point where the copy will end. The End point is the last point - the End point. The last point has base 0. -- @param #number End The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.
@@ -725,7 +725,7 @@ function POSITIONABLE:InAir()
return nil return nil
end end
--- Returns the a @{Velocity} object from the POSITIONABLE. --- Returns the @{Core.Velocity} object from the POSITIONABLE.
-- @param #POSITIONABLE self -- @param #POSITIONABLE self
-- @return Core.Velocity#VELOCITY Velocity The Velocity object. -- @return Core.Velocity#VELOCITY Velocity The Velocity object.
-- @return #nil The POSITIONABLE is not existing or alive. -- @return #nil The POSITIONABLE is not existing or alive.
@@ -1815,7 +1815,7 @@ function POSITIONABLE:SmokeBlue()
trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue ) trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue )
end end
--- Returns true if the unit is within a @{Zone}. --- Returns true if the unit is within a @{Core.Zone}.
-- @param #POSITIONABLE self -- @param #POSITIONABLE self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the unit is within the @{Core.Zone#ZONE_BASE} -- @return #boolean Returns true if the unit is within the @{Core.Zone#ZONE_BASE}
@@ -1830,7 +1830,7 @@ function POSITIONABLE:IsInZone( Zone )
return false return false
end end
--- Returns true if the unit is not within a @{Zone}. --- Returns true if the unit is not within a @{Core.Zone}.
-- @param #POSITIONABLE self -- @param #POSITIONABLE self
-- @param Core.Zone#ZONE_BASE Zone The zone to test. -- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the unit is not within the @{Core.Zone#ZONE_BASE} -- @return #boolean Returns true if the unit is not within the @{Core.Zone#ZONE_BASE}
+5 -5
View File
@@ -26,19 +26,19 @@
-- --
-- ## STATIC reference methods -- ## STATIC reference methods
-- --
-- For each DCS Static will have a STATIC wrapper object (instance) within the _@{DATABASE} object. -- For each DCS Static will have a STATIC wrapper object (instance) within the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- This is done at the beginning of the mission (when the mission starts). -- This is done at the beginning of the mission (when the mission starts).
-- --
-- The STATIC class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference -- The @{#STATIC} class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
-- using the Static Name. -- using the Static Name.
-- --
-- Another thing to know is that STATIC objects do not "contain" the DCS Static object. -- Another thing to know is that STATIC objects do not "contain" the DCS Static object.
-- The STATIc methods will reference the DCS Static object by name when it is needed during API execution. -- The @{#STATIC} methods will reference the DCS Static object by name when it is needed during API execution.
-- If the DCS Static object does not exist or is nil, the STATIC methods will return nil and log an exception in the DCS.log file. -- If the DCS Static object does not exist or is nil, the STATIC methods will return nil and log an exception in the DCS.log file.
-- --
-- The STATIc class provides the following functions to retrieve quickly the relevant STATIC instance: -- The @{#STATIC} class provides the following functions to retrieve quickly the relevant STATIC instance:
-- --
-- * @{#STATIC.FindByName}(): Find a STATIC instance from the _DATABASE object using a DCS Static name. -- * @{#STATIC.FindByName}(): Find a STATIC instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Static name.
-- --
-- IMPORTANT: ONE SHOULD NEVER SANITIZE these STATIC OBJECT REFERENCES! (make the STATIC object references nil). -- IMPORTANT: ONE SHOULD NEVER SANITIZE these STATIC OBJECT REFERENCES! (make the STATIC object references nil).
-- --
+5 -5
View File
@@ -27,8 +27,8 @@
-- @field #string GroupName Name of the group the unit belongs to. -- @field #string GroupName Name of the group the unit belongs to.
-- @extends Wrapper.Controllable#CONTROLLABLE -- @extends Wrapper.Controllable#CONTROLLABLE
--- For each DCS Unit object alive within a running mission, a UNIT wrapper object (instance) will be created within the _@{DATABASE} object. --- For each DCS Unit object alive within a running mission, a UNIT wrapper object (instance) will be created within the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Unit objects are spawned (using the @{SPAWN} class). -- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Unit objects are spawned (using the @{Core.Spawn} class).
-- --
-- The UNIT class **does not contain a :New()** method, rather it provides **:Find()** methods to retrieve the object reference -- The UNIT class **does not contain a :New()** method, rather it provides **:Find()** methods to retrieve the object reference
-- using the DCS Unit or the DCS UnitName. -- using the DCS Unit or the DCS UnitName.
@@ -39,8 +39,8 @@
-- --
-- The UNIT class provides the following functions to retrieve quickly the relevant UNIT instance: -- The UNIT class provides the following functions to retrieve quickly the relevant UNIT instance:
-- --
-- * @{#UNIT.Find}(): Find a UNIT instance from the _DATABASE object using a DCS Unit object. -- * @{#UNIT.Find}(): Find a UNIT instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Unit object.
-- * @{#UNIT.FindByName}(): Find a UNIT instance from the _DATABASE object using a DCS Unit name. -- * @{#UNIT.FindByName}(): Find a UNIT instance from the global _DATABASE object (an instance of @{Core.Database#DATABASE}) using a DCS Unit name.
-- --
-- IMPORTANT: ONE SHOULD NEVER SANITIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil). -- IMPORTANT: ONE SHOULD NEVER SANITIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil).
-- --
@@ -644,7 +644,7 @@ end
-- Need to add here functions to check if radar is on and which object etc. -- Need to add here functions to check if radar is on and which object etc.
--- Returns the prefix name of the DCS Unit. A prefix name is a part of the name before a '#'-sign. --- Returns the prefix name of the DCS Unit. A prefix name is a part of the name before a '#'-sign.
-- DCS Units spawned with the @{SPAWN} class contain a '#'-sign to indicate the end of the (base) DCS Unit name. -- DCS Units spawned with the @{Core.Spawn#SPAWN} class contain a '#'-sign to indicate the end of the (base) DCS Unit name.
-- The spawn sequence number and unit number are contained within the name after the '#' sign. -- The spawn sequence number and unit number are contained within the name after the '#' sign.
-- @param #UNIT self -- @param #UNIT self
-- @return #string The name of the DCS Unit. -- @return #string The name of the DCS Unit.