Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.
Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.
Controller is an object that performs A.I.-routines.
+
+
+
Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands. Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.
+
+
This class has 2 types of functions:
+
+
+
Tasks
+
Commands: Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.
If one or more detection method is specified the function will return targets which were detected by at least one of these methods. If no detection methods are specified the function will return targets which were detected by any method.
If one or more detection method is specified the function will return true if the target is detected by at least one of these methods. If no detection methods are specified the function will return true if the target is detected by any method.
Pushes the task to the front of the queue and makes the task active.
+
+
+
Further call of function Controller.setTask() function will stop current task, clear the queue and set the new task active. If the task queue is empty the function will work like function Controller.setTask() function.
Option is a pair of identifier and value. Behavior options are global parameters those affect controller behavior in all tasks it performs.
+Option identifiers and values are stored in table AI.Option in subtables Air, Ground and Naval.
If some of the units will be destroyed, initial size of the group will not be changed. Initial size limits the unitNumber parameter for Group.getUnit() function.
Object type is a named couple of properties those independent of mission and common for all units of the same type. Name of unit type is a string. Samples of unit type: "Su-27", "KAMAZ" and "M2 Bradley".
The number is the same number the unit has in ME. It may not be changed during the mission. If any unit in the group is destroyed, the numbers of another units will not be changed.
Returns true if the unit has specified types of sensors.
+
+
+
This function is more preferable than Unit.getSensors() if you don't want to get information about all the unit's sensors, and just want to check if the unit has specified types of sensors.
If sensorType is Unit.SensorType.OPTIC, additional parameters are optic sensor types. Following example checks if the unit has LLTV or IR optics:
+unit:hasSensors(Unit.SensorType.OPTIC, Unit.OpticType.LLTV, Unit.OpticType.IR)
+If sensorType is Unit.SensorType.RADAR, additional parameters are radar types. Following example checks if the unit has air search radars:
+unit:hasSensors(Unit.SensorType.RADAR, Unit.RadarType.AS)
+If no additional parameters are specified the function returns true if the unit has at least one sensor of specified type.
+If sensor type is not specified the function returns true if the unit has at least one sensor of any type.
+
Time function FunctionToCall(any argument, Time time)
+
+
...
+
+
return ...
+
+
end
+
+
Must return model time of next call or nil. Note that the DCS scheduler calls the function in protected mode and any Lua errors in the called function will be trapped and not reported. If the function triggers a Lua error then it will be terminated and not scheduled to run again.
+
+
Parameters
+
+
+
+
#FunctionToCall functionToCall :
+Lua-function to call. Must have prototype of FunctionToCall.
+
+
+
+
+
functionArgument :
+Function argument of any type to pass to functionToCall.
string :
+DestroyGroupType Text describing the group to be destroyed. f.e. "Radar Installations", "Ships", "Vehicles", "Command Centers".
+
+
+
+
+
string :
+DestroyUnitType Text describing the unit types to be destroyed. f.e. "SA-6", "Row Boats", "Tanks", "Tents".
+
+
+
+
+
table :
+string,...} DestroyGroupPrefixes Table of Prefixes of the Groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
string :
+DestroyGroupType String describing the group to be destroyed.
+
+
+
+
+
string :
+DestroyUnitType String describing the unit to be destroyed.
+
+
+
+
+
table :
+string,...} DestroyGroupNames Table of string containing the name of the groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
+-@return DESTROYGROUPSTASK
Creates a new DATABASE Object to administer the Groups defined and alive within the DCSRTE.
+
+
Return value
+
+
+
DATABASE
+
+
Usage:
+
-- Define a new DATABASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
+DBObject = DATABASE:New()
This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
+SpawnCountryID, SpawnCategoryID
+This method is used by the SPAWN class.
A MISSION is the main owner of a Mission orchestration within MOOSE .
+
+
+
The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc.
+A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.
_TransportExecuteStage: Defines the different stages of Transport unload/load execution. This table is internal and is used to control the validity of Transport load/unload timing.
Register a new CLIENT to participate within the mission.
+
+
Parameters
+
+
+
+
CLIENT :
+Client is the CLIENT object. The object must have been instantiated with CLIENT.
+
+
+
+
+
self :
+
+
+
+
+
Client :
+
+
+
+
Return value
+
+
+
CLIENT
+
+
Usage:
+
Add a number of Client objects to the Mission.
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Goal functions are called when a TASK within a mission has been completed.
+
+
Parameters
+
+
+
+
function :
+GoalFunction is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
+
+
+
+
+
self :
+
+
+
+
+
GoalFunction :
+
+
+
+
Usage:
+
PatriotActivation = {
+ { "US SAM Patriot Zerti", false },
+ { "US SAM Patriot Zegduleti", false },
+ { "US SAM Patriot Gvleti", false }
+ }
+
+ function DeployPatriotTroopsGoal( Mission, Client )
+
+
+ -- Check if the cargo is all deployed for mission success.
+ for CargoID, CargoData in pairs( Mission._Cargos ) do
+ if Group.getByName( CargoData.CargoGroupName ) then
+ CargoGroup = Group.getByName( CargoData.CargoGroupName )
+ if CargoGroup then
+ -- Check if the cargo is ready to activate
+ CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) -- The second task is the Deploytask to measure mission success upon
+ if CurrentLandingZoneID then
+ if PatriotActivation[CurrentLandingZoneID][2] == false then
+ -- Now check if this is a new Mission Task to be completed...
+ trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
+ PatriotActivation[CurrentLandingZoneID][2] = true
+ MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
+ MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
+ Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) -- Register Patriot activation as part of mission goal.
+ end
+ end
+ end
+ end
+ end
+ end
+
+ local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+ Mission:AddGoalFunction( DeployPatriotTroopsGoal )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameters
+
+
+
+
string :
+MissionName is the name of the mission. This name will be used to reference the status of each mission by the players.
+
+
+
+
+
string :
+MissionPriority is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.
+
+
+
+
+
string :
+MissionBriefing is a string indicating the mission briefing to be shown when a player joins a CLIENT.
+
+
+
+
+
string :
+MissionCoalition is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
+
+
+
+
+
self :
+
+
+
+
+
MissionName :
+
+
+
+
+
MissionPriority :
+
+
+
+
+
MissionBriefing :
+
+
+
+
+
MissionCoalition :
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a few missions.
+local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Patriots', 'Primary', 'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Package Delivery', 'Operational', 'In order to be in full control of the situation, we need you to deliver a very important package at a secret location. Fly undetected through the NATO defenses and deliver the secret package. The secret agent is located at waypoint 4.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue General', 'Tactical', 'Our intelligence has received a remote signal behind Gori. We believe it is a very important Russian General that was captured by Georgia. Go out there and rescue him! Ensure you stay out of the battle zone, keep south. Waypoint 4 is the location of our Russian General.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'SA-6 SAMs', 'Primary', 'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Sling Load', 'Operational', 'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical', 'In order to be in full control of the situation, we need you to rescue a secret agent from the woods behind enemy lines. Avoid the Russian defenses and rescue the agent. Keep south until Khasuri, and keep your eyes open for any SAM presence. The agent is located at waypoint 4 on your kneeboard.', 'NATO' )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameter
+
+
+
+
Mission :
+is the MISSION object instantiated by MISSION.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now find the Mission.
+MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now remove the Mission.
+MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )
Limit the simultaneous movement of Groups within a running Mission.
+
+
+
This module is defined to improve the performance in missions, and to bring additional realism for GROUND vehicles.
+Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if
+the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units
+on defined intervals (currently every minute).
Message System to display Messages for Clients and Coalitions or All.
+
+
+
Messages are grouped on the display panel per Category to improve readability for the players.
+Messages are shown on the display panel for an amount of seconds, and will then disappear.
+Messages are identified by an ID. The messages with the same ID belonging to the same category will be overwritten if they were still being displayed on the display panel.
+Messages are created with MESSAGE:New().
+Messages are sent to Clients with MESSAGE:ToClient().
+Messages are sent to Coalitions with MESSAGE:ToCoalition().
+Messages are sent to All Players with MESSAGE:ToAll().
Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.
+
+
Parameters
+
+
+
+
#string MessageText :
+is the text of the Message.
+
+
+
+
+
#string MessageCategory :
+is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability.
+
+
+
+
+
#number MessageDuration :
+is a number in seconds of how long the MESSAGE should be shown on the display panel.
+
+
+
+
+
#string MessageID :
+is a string expressing the ID of the Message.
-- Create a series of new Messages.
+-- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
+-- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
-- Send a message created to all players.
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageAll:ToAll()
-- Send a message created with the @{New} method to the BLUE coalition.
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageBLUE:ToBlue()
-- Send the 2 messages created with the @{New} method to the Client Group.
+-- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
+ClientGroup = Group.getByName( "ClientGroup" )
+
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
+MessageClient1:ToClient( ClientGroup )
+MessageClient2:ToClient( ClientGroup )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToCoalition( coalition.side.RED )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToRed()
_TransportStage: Defines the different stages of which of transport missions can be in. This table is internal and is used to control the sequence of messages, actions and flow.
Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.
+
+
+
When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions...
+Chances are big that the missile will miss.
+
+
Parameters
+
+
+
+
table :
+string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken.
The SPAWN class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
+For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the "Spawn Template" of the SPAWN object.
+A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.
+
+
Within the SPAWN object, there is an internal index that keeps track of which group from the internal group list was spawned.
+When new groups get spawned by using the SPAWN functions (see below), it will be validated whether the Limits (SPAWN.Limit) of the SPAWN object are not reached.
+When all is valid, a new group will be created by the spawning methods, and the internal index will be increased with 1.
+
+
Regarding the name of new spawned groups, a SpawnPrefix will be assigned for each new group created.
+If you want to have the Spawn Template name to be used as the SpawnPrefix name, use the SPAWN.New constructor.
+However, when the SPAWN.NewWithAlias constructor was used, the Alias name will define the SpawnPrefix name.
+Groups will follow the following naming structure when spawned at run-time:
+
+
+
Spawned groups will have the name SpawnPrefix#ggg, where ggg is a counter from 0 to 999.
+
Spawned units will have the name SpawnPrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned unit belonging to the group.
+
+
+
Some additional notes that need to be remembered:
+
+
+
Templates are actually groups defined within the mission editor, with the flag "Late Activation" set. As such, these groups are never used within the mission, but are used by the #SPAWN module.
+
It is important to defined BEFORE you spawn new groups, a proper initialization of the SPAWN instance is done with the options you want to use.
+
When designing a mission, NEVER name groups using a "#" within the name of the group Spawn Template(s), or the SPAWN module logic won't work anymore.
SPAWN.New: Creates a new SPAWN object taking the name of the group that functions as the Template.
+
+
+
It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned.
+The initialization functions will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons.
+So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.
+
+
+
SPAWN object initialization methods:
+
A spawn object will behave differently based on the usage of initialization methods:
+
SPAWN.Limit: Limits the amount of groups that can be alive at the same time and that can be dynamically spawned.
SPAWN.RandomizeTemplate: Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined.
Note that SPAWN.Spawn and SPAWN.ReSpawn return a 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.
+
+
+
SPAWN object cleaning:
+
+ Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive.
+ In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't,
+ and it may occur that no new groups are or can be spawned as limits are reached.
+ To prevent this, a SPAWN.CleanUp initialization method has been defined that will silently monitor the status of each spawned group.
+ Once a group has a velocity = 0, and has been waiting for a defined interval, that group will be cleaned or removed from run-time.
+ There is a catch however :-) If a damaged group has returned to an airbase within the coalition, that group will not be considered as "lost"...
+ In such a case, when the inactive group is cleaned, a new group will Re-spawned automatically.
+ This models AI that has succesfully returned to their airbase, to restart their combat activities.
+ Check the SPAWN.CleanUp for further info.
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
CleanUp groups when they are still alive, but inactive.
+
+
+
When groups are still alive and have become inactive due to damage and are unable to contribute anything, then this group will be removed at defined intervals in seconds.
+
+
Parameter
+
+
+
+
#string SpawnCleanUpInterval :
+The interval to check for inactive groups within seconds.
Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.
+
+
+
Note that this method is exceptionally important to balance the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units.
+If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this function should be used...
+When a SPAWN.New is executed and the limit of the amount of units alive is reached, then no new spawn will happen of the group, until some of these units of the spawn object will be destroyed.
+
+
Parameters
+
+
+
+
#number SpawnMaxUnitsAlive :
+The maximum amount of units that can be alive at runtime.
+
+
+
+
+
#number SpawnMaxGroups :
+The maximum amount of groups that can be spawned. When the limit is reached, then no more actual spawns will happen of the group.
+This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area.
+This parameter accepts the value 0, which defines that there are no maximum group limits, but there are limits on the maximum of units that can be alive at the same time.
-- NATO helicopters engaging in the battle field.
+-- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
+-- There will be maximum 24 groups spawned during the whole mission lifetime.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Limit( 2, 24 )
Creates the main object to spawn a GROUP defined in the DCS ME.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefix :
+is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
+
local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:NewWithAlias( 'BE KA-50@RAMP-Ground Defense', 'Helicopter Attacking a City' )
+
local PlaneWithAlias = SPAWN:NewWithAlias( "Plane", "Bomber" ) -- Creates a new local variable that can instantiate new planes with the name "Bomber#ddd" using the template "Plane" as defined within the ME.
Randomizes the defined route of the SpawnTemplatePrefix group in the ME.
+
+
+
This is very useful to define extra variation of the behaviour of groups.
+
+
Parameters
+
+
+
+
#number SpawnStartPoint :
+is the waypoint where the randomization begins.
+Note that the StartPoint = 0 equaling the point where the group is spawned.
+
+
+
+
+
#number SpawnEndPoint :
+is the waypoint where the randomization ends counting backwards.
+This parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.
+
+
+
+
+
#number SpawnRadius :
+is the radius in meters in which the randomization of the new waypoints, with the original waypoint of the original template located in the middle ...
-- NATO helicopters engaging in the battle field.
+-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP).
+-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
+-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):RandomizeRoute( 2, 2, 2000 )
This function is rather complicated to understand.
+
+
+
But I'll try to explain.
+This function becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
+but they will all follow the same Template route and have the same prefix name.
+In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefixTable :
+A table with the names of the groups defined within the mission editor, from which one will be choosen when a new group will be spawned.
-- NATO Tank Platoons invading Gori.
+-- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be spawned for the
+-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
+-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
+-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
+Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5',
+ 'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10',
+ 'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
+Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
+
+
+
This function is used to re-spawn automatically (so no extra call is needed anymore) the same group after it has landed.
+This will enable a spawned group to be re-spawned after it lands, until it is destroyed...
+Note: When the group is respawned, it will re-spawn from the original airbase where it took off.
+So ensure that the routes for groups that respawn, always return to the original airbase, or players may get confused ...
This function is mostly advisable to be used if you want to simulate spawning from air units, like helicopters, which are dropping infantry into a defined Landing Zone.
+Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
+You can use the returned group to further define the route to be followed.
+
+
Parameters
+
+
+
+
Unit#UNIT HostUnit :
+The air or ground unit dropping or unloading the group.
+
+
+
+
+
#number OuterRadius :
+The outer radius in meters where the new group will be spawned.
+
+
+
+
+
#number InnerRadius :
+The inner radius in meters where the new group will NOT be spawned.
+
+
+
+
+
#number SpawnIndex :
+(Optional) The index which group to spawn within the given zone.
This is useful if you want to have continuity within your missions of certain (AI) groups to be present (alive) within your missions.
+
+
Parameters
+
+
+
+
#number SpawnTime :
+The time interval defined in seconds between each new spawn of new groups.
+
+
+
+
+
#number SpawnTimeVariation :
+The variation to be applied on the defined time interval between each new spawn.
+The variation is a number between 0 and 1, representing the %-tage of variation to be applied on the time interval.
-- NATO helicopters engaging in the battle field.
+-- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
+-- The time variation in this case will be between 450 seconds and 750 seconds.
+-- This is calculated as follows:
+-- Low limit: 600 * ( 1 - 0.5 / 2 ) = 450
+-- High limit: 600 * ( 1 + 0.5 / 2 ) = 750
+-- Between these two values, a random amount of seconds will be choosen for each new spawn of the helicopters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
When the event takes place, the spawned Group is registered as airborne...
+This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.
When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
string :
+DestroyGroupType Text describing the group to be destroyed. f.e. "Radar Installations", "Ships", "Vehicles", "Command Centers".
+
+
+
+
+
string :
+DestroyUnitType Text describing the unit types to be destroyed. f.e. "SA-6", "Row Boats", "Tanks", "Tents".
+
+
+
+
+
table :
+string,...} DestroyGroupPrefixes Table of Prefixes of the Groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
string :
+DestroyGroupType String describing the group to be destroyed.
+
+
+
+
+
string :
+DestroyUnitType String describing the unit to be destroyed.
+
+
+
+
+
table :
+string,...} DestroyGroupNames Table of string containing the name of the groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
+-@return DESTROYGROUPSTASK
Creates a new DATABASE Object to administer the Groups defined and alive within the DCSRTE.
+
+
Return value
+
+
+
DATABASE
+
+
Usage:
+
-- Define a new DATABASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
+DBObject = DATABASE:New()
This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
+SpawnCountryID, SpawnCategoryID
+This method is used by the SPAWN class.
A MISSION is the main owner of a Mission orchestration within MOOSE .
+
+
+
The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc.
+A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.
_TransportExecuteStage: Defines the different stages of Transport unload/load execution. This table is internal and is used to control the validity of Transport load/unload timing.
Register a new CLIENT to participate within the mission.
+
+
Parameters
+
+
+
+
CLIENT :
+Client is the CLIENT object. The object must have been instantiated with CLIENT.
+
+
+
+
+
self :
+
+
+
+
+
Client :
+
+
+
+
Return value
+
+
+
CLIENT
+
+
Usage:
+
Add a number of Client objects to the Mission.
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Goal functions are called when a TASK within a mission has been completed.
+
+
Parameters
+
+
+
+
function :
+GoalFunction is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
+
+
+
+
+
self :
+
+
+
+
+
GoalFunction :
+
+
+
+
Usage:
+
PatriotActivation = {
+ { "US SAM Patriot Zerti", false },
+ { "US SAM Patriot Zegduleti", false },
+ { "US SAM Patriot Gvleti", false }
+ }
+
+ function DeployPatriotTroopsGoal( Mission, Client )
+
+
+ -- Check if the cargo is all deployed for mission success.
+ for CargoID, CargoData in pairs( Mission._Cargos ) do
+ if Group.getByName( CargoData.CargoGroupName ) then
+ CargoGroup = Group.getByName( CargoData.CargoGroupName )
+ if CargoGroup then
+ -- Check if the cargo is ready to activate
+ CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) -- The second task is the Deploytask to measure mission success upon
+ if CurrentLandingZoneID then
+ if PatriotActivation[CurrentLandingZoneID][2] == false then
+ -- Now check if this is a new Mission Task to be completed...
+ trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
+ PatriotActivation[CurrentLandingZoneID][2] = true
+ MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
+ MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
+ Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) -- Register Patriot activation as part of mission goal.
+ end
+ end
+ end
+ end
+ end
+ end
+
+ local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+ Mission:AddGoalFunction( DeployPatriotTroopsGoal )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameters
+
+
+
+
string :
+MissionName is the name of the mission. This name will be used to reference the status of each mission by the players.
+
+
+
+
+
string :
+MissionPriority is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.
+
+
+
+
+
string :
+MissionBriefing is a string indicating the mission briefing to be shown when a player joins a CLIENT.
+
+
+
+
+
string :
+MissionCoalition is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
+
+
+
+
+
self :
+
+
+
+
+
MissionName :
+
+
+
+
+
MissionPriority :
+
+
+
+
+
MissionBriefing :
+
+
+
+
+
MissionCoalition :
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a few missions.
+local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Patriots', 'Primary', 'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Package Delivery', 'Operational', 'In order to be in full control of the situation, we need you to deliver a very important package at a secret location. Fly undetected through the NATO defenses and deliver the secret package. The secret agent is located at waypoint 4.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue General', 'Tactical', 'Our intelligence has received a remote signal behind Gori. We believe it is a very important Russian General that was captured by Georgia. Go out there and rescue him! Ensure you stay out of the battle zone, keep south. Waypoint 4 is the location of our Russian General.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'SA-6 SAMs', 'Primary', 'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Sling Load', 'Operational', 'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical', 'In order to be in full control of the situation, we need you to rescue a secret agent from the woods behind enemy lines. Avoid the Russian defenses and rescue the agent. Keep south until Khasuri, and keep your eyes open for any SAM presence. The agent is located at waypoint 4 on your kneeboard.', 'NATO' )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameter
+
+
+
+
Mission :
+is the MISSION object instantiated by MISSION.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now find the Mission.
+MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now remove the Mission.
+MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )
Limit the simultaneous movement of Groups within a running Mission.
+
+
+
This module is defined to improve the performance in missions, and to bring additional realism for GROUND vehicles.
+Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if
+the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units
+on defined intervals (currently every minute).
Message System to display Messages for Clients and Coalitions or All.
+
+
+
Messages are grouped on the display panel per Category to improve readability for the players.
+Messages are shown on the display panel for an amount of seconds, and will then disappear.
+Messages are identified by an ID. The messages with the same ID belonging to the same category will be overwritten if they were still being displayed on the display panel.
+Messages are created with MESSAGE:New().
+Messages are sent to Clients with MESSAGE:ToClient().
+Messages are sent to Coalitions with MESSAGE:ToCoalition().
+Messages are sent to All Players with MESSAGE:ToAll().
Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.
+
+
Parameters
+
+
+
+
#string MessageText :
+is the text of the Message.
+
+
+
+
+
#string MessageCategory :
+is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability.
+
+
+
+
+
#number MessageDuration :
+is a number in seconds of how long the MESSAGE should be shown on the display panel.
+
+
+
+
+
#string MessageID :
+is a string expressing the ID of the Message.
-- Create a series of new Messages.
+-- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
+-- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
-- Send a message created to all players.
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageAll:ToAll()
-- Send a message created with the @{New} method to the BLUE coalition.
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageBLUE:ToBlue()
-- Send the 2 messages created with the @{New} method to the Client Group.
+-- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
+ClientGroup = Group.getByName( "ClientGroup" )
+
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
+MessageClient1:ToClient( ClientGroup )
+MessageClient2:ToClient( ClientGroup )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToCoalition( coalition.side.RED )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToRed()
_TransportStage: Defines the different stages of which of transport missions can be in. This table is internal and is used to control the sequence of messages, actions and flow.
Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.
+
+
+
When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions...
+Chances are big that the missile will miss.
+
+
Parameters
+
+
+
+
table :
+string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken.
The SPAWN class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
+For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the "Spawn Template" of the SPAWN object.
+A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.
+
+
Within the SPAWN object, there is an internal index that keeps track of which group from the internal group list was spawned.
+When new groups get spawned by using the SPAWN functions (see below), it will be validated whether the Limits (SPAWN.Limit) of the SPAWN object are not reached.
+When all is valid, a new group will be created by the spawning methods, and the internal index will be increased with 1.
+
+
Regarding the name of new spawned groups, a SpawnPrefix will be assigned for each new group created.
+If you want to have the Spawn Template name to be used as the SpawnPrefix name, use the SPAWN.New constructor.
+However, when the SPAWN.NewWithAlias constructor was used, the Alias name will define the SpawnPrefix name.
+Groups will follow the following naming structure when spawned at run-time:
+
+
+
Spawned groups will have the name SpawnPrefix#ggg, where ggg is a counter from 0 to 999.
+
Spawned units will have the name SpawnPrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned unit belonging to the group.
+
+
+
Some additional notes that need to be remembered:
+
+
+
Templates are actually groups defined within the mission editor, with the flag "Late Activation" set. As such, these groups are never used within the mission, but are used by the #SPAWN module.
+
It is important to defined BEFORE you spawn new groups, a proper initialization of the SPAWN instance is done with the options you want to use.
+
When designing a mission, NEVER name groups using a "#" within the name of the group Spawn Template(s), or the SPAWN module logic won't work anymore.
SPAWN.New: Creates a new SPAWN object taking the name of the group that functions as the Template.
+
+
+
It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned.
+The initialization functions will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons.
+So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.
+
+
+
SPAWN object initialization methods:
+
A spawn object will behave differently based on the usage of initialization methods:
+
SPAWN.Limit: Limits the amount of groups that can be alive at the same time and that can be dynamically spawned.
SPAWN.RandomizeTemplate: Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined.
Note that SPAWN.Spawn and SPAWN.ReSpawn return a 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.
+
+
+
SPAWN object cleaning:
+
+ Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive.
+ In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't,
+ and it may occur that no new groups are or can be spawned as limits are reached.
+ To prevent this, a SPAWN.CleanUp initialization method has been defined that will silently monitor the status of each spawned group.
+ Once a group has a velocity = 0, and has been waiting for a defined interval, that group will be cleaned or removed from run-time.
+ There is a catch however :-) If a damaged group has returned to an airbase within the coalition, that group will not be considered as "lost"...
+ In such a case, when the inactive group is cleaned, a new group will Re-spawned automatically.
+ This models AI that has succesfully returned to their airbase, to restart their combat activities.
+ Check the SPAWN.CleanUp for further info.
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
CleanUp groups when they are still alive, but inactive.
+
+
+
When groups are still alive and have become inactive due to damage and are unable to contribute anything, then this group will be removed at defined intervals in seconds.
+
+
Parameter
+
+
+
+
#string SpawnCleanUpInterval :
+The interval to check for inactive groups within seconds.
Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.
+
+
+
Note that this method is exceptionally important to balance the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units.
+If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this function should be used...
+When a SPAWN.New is executed and the limit of the amount of units alive is reached, then no new spawn will happen of the group, until some of these units of the spawn object will be destroyed.
+
+
Parameters
+
+
+
+
#number SpawnMaxUnitsAlive :
+The maximum amount of units that can be alive at runtime.
+
+
+
+
+
#number SpawnMaxGroups :
+The maximum amount of groups that can be spawned. When the limit is reached, then no more actual spawns will happen of the group.
+This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area.
+This parameter accepts the value 0, which defines that there are no maximum group limits, but there are limits on the maximum of units that can be alive at the same time.
-- NATO helicopters engaging in the battle field.
+-- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
+-- There will be maximum 24 groups spawned during the whole mission lifetime.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Limit( 2, 24 )
Creates the main object to spawn a GROUP defined in the DCS ME.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefix :
+is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
+
local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:NewWithAlias( 'BE KA-50@RAMP-Ground Defense', 'Helicopter Attacking a City' )
+
local PlaneWithAlias = SPAWN:NewWithAlias( "Plane", "Bomber" ) -- Creates a new local variable that can instantiate new planes with the name "Bomber#ddd" using the template "Plane" as defined within the ME.
Randomizes the defined route of the SpawnTemplatePrefix group in the ME.
+
+
+
This is very useful to define extra variation of the behaviour of groups.
+
+
Parameters
+
+
+
+
#number SpawnStartPoint :
+is the waypoint where the randomization begins.
+Note that the StartPoint = 0 equaling the point where the group is spawned.
+
+
+
+
+
#number SpawnEndPoint :
+is the waypoint where the randomization ends counting backwards.
+This parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.
+
+
+
+
+
#number SpawnRadius :
+is the radius in meters in which the randomization of the new waypoints, with the original waypoint of the original template located in the middle ...
-- NATO helicopters engaging in the battle field.
+-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP).
+-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
+-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):RandomizeRoute( 2, 2, 2000 )
This function is rather complicated to understand.
+
+
+
But I'll try to explain.
+This function becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
+but they will all follow the same Template route and have the same prefix name.
+In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefixTable :
+A table with the names of the groups defined within the mission editor, from which one will be choosen when a new group will be spawned.
-- NATO Tank Platoons invading Gori.
+-- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be spawned for the
+-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
+-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
+-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
+Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5',
+ 'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10',
+ 'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
+Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
+
+
+
This function is used to re-spawn automatically (so no extra call is needed anymore) the same group after it has landed.
+This will enable a spawned group to be re-spawned after it lands, until it is destroyed...
+Note: When the group is respawned, it will re-spawn from the original airbase where it took off.
+So ensure that the routes for groups that respawn, always return to the original airbase, or players may get confused ...
This function is mostly advisable to be used if you want to simulate spawning from air units, like helicopters, which are dropping infantry into a defined Landing Zone.
+Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
+You can use the returned group to further define the route to be followed.
+
+
Parameters
+
+
+
+
Unit#UNIT HostUnit :
+The air or ground unit dropping or unloading the group.
+
+
+
+
+
#number OuterRadius :
+The outer radius in meters where the new group will be spawned.
+
+
+
+
+
#number InnerRadius :
+The inner radius in meters where the new group will NOT be spawned.
+
+
+
+
+
#number SpawnIndex :
+(Optional) The index which group to spawn within the given zone.
This is useful if you want to have continuity within your missions of certain (AI) groups to be present (alive) within your missions.
+
+
Parameters
+
+
+
+
#number SpawnTime :
+The time interval defined in seconds between each new spawn of new groups.
+
+
+
+
+
#number SpawnTimeVariation :
+The variation to be applied on the defined time interval between each new spawn.
+The variation is a number between 0 and 1, representing the %-tage of variation to be applied on the time interval.
-- NATO helicopters engaging in the battle field.
+-- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
+-- The time variation in this case will be between 450 seconds and 750 seconds.
+-- This is calculated as follows:
+-- Low limit: 600 * ( 1 - 0.5 / 2 ) = 450
+-- High limit: 600 * ( 1 + 0.5 / 2 ) = 750
+-- Between these two values, a random amount of seconds will be choosen for each new spawn of the helicopters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
When the event takes place, the spawned Group is registered as airborne...
+This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.
When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
This is the worker method to retrieve the Parent class.
-
-
-
-
-
-
-
-
Methods
-
-
-
-
- BASE:New ()
-
-
- The base constructor. This is the top top class of all classed defined within the MOOSE.
- Any new class needs to be derived from this class for proper inheritance.
-
-
-
-
- Clients are those Groups defined within the Mission Editor that have the skillset defined as "Client" or "Player".
- These clients are defined within the Mission Orchestration Framework (MOF)
-
-
-
-
-
-
-
-
-
-
Fields
-
-
-
-
- self.CargoGroupName
-
-
- ReSpawn the Cargo from the CargoHost
-
-
-
-
-
-
-
-
-
-
- self.CargoGroupName
-
-
- ReSpawn the Cargo in the CargoZone without a host ...
-
-
-
-
-
-
-
-
- Add Cargo to the mission... Cargo functionality needs to be reworked a bit, so this is still under construction. I need to make a CARGO Class...
-
-
-
Parameters:
-
-
CargoType
-
-
-
CargoName
-
-
-
CargoWeight
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
At the defined time interval, CleanUp the Groups within the CleanUpList.
-
-
-
-
-
-
-
-
Methods
-
-
-
-
- CLEANUP:New (ZoneNames, TimeInterval)
-
-
- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
-
-
-
Parameters:
-
-
ZoneNames
- table{string,...} or string
- which is a table of zone names where the debris should be cleaned. Also a single string can be passed with one zone name.
-
-
TimeInterval
- optional number
- is the interval in seconds when the clean activity takes place. The default is 300 seconds, thus every 5 minutes.
-
- Detects if the Unit has an S_EVENT_HIT within the given ZoneNames. If this is the case, destroy the unit.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_EventAddForCleanUp (event)
-
-
- Detects if the Unit has an S_EVENT_ENGINE_SHUTDOWN or an S_EVENT_HIT within the given ZoneNames. If this is the case, add the Group to the CLEANUP List.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_Scheduler ()
-
-
- At the defined time interval, CleanUp the Groups within the CleanUpList.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
Message is the key Message driver for the CLIENT class.
-
-
-
-
-
-
-
-
Tables
-
-
-
-
- CLIENT.CLIENT
-
-
- Clients are those Groups defined within the Mission Editor that have the skillset defined as "Client" or "Player".
- These clients are defined within the Mission Orchestration Framework (MOF)
-
-
-
Fields:
-
-
ONBOARDSIDE
-
-
-
LEFT
-
-
-
RIGHT
-
-
-
BACK
-
-
-
FRONT
-
-
-
-
-
-
-
-
-
-
-
Methods
-
-
-
-
- CLIENT:New (ClientName, ClientBriefing)
-
-
- Use this method to register new Clients within the MOF.
-
-
-
Parameters:
-
-
ClientName
- string
- Name of the Group as defined within the Mission Editor. The Group must have a Unit with the type Client.
-
-
ClientBriefing
- string
- Text that describes the briefing of the mission when a Player logs into the Client.
-
- Message is the key Message driver for the CLIENT class.
- This function displays various messages to the Player logged into the CLIENT through the DCS World Messaging system.
-
-
-
Parameters:
-
-
Message
- string
- is the text describing the message.
-
-
MessageDuration
- number
- is the duration in seconds that the Message should be displayed.
-
-
MessageId
- string
- is a text identifying the Message in the MessageQueue. The Message system overwrites Messages with the same MessageId
-
-
MessageCategory
- string
- is the category of the message (the title).
-
-
MessageInterval
- number
- is the interval in seconds between the display of the Message when the CLIENT is in the air.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
- -- Define a new DATABASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
- DBObject = DATABASE:New()
-
-
-
-
-
- DATABASE:Spawn (SpawnTemplate)
-
-
- Instantiate new Groups within the DCSRTE.
- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
- SpawnCountryID, SpawnCategoryID
- This method is used by the SPAWN class.
-
-
-
Parameters:
-
-
SpawnTemplate
-
-
-
-
-
-
-
-
-
-
-
- DATABASE:SetStatusGroup (GroupName, Status)
-
-
- Set a status to a Group within the Database, this to check crossing events for example.
-
-
-
Parameters:
-
-
GroupName
-
-
-
Status
-
-
-
-
-
-
-
-
-
-
-
- DATABASE:GetStatusGroup (GroupName)
-
-
- Get a status to a Group within the Database, this to check crossing events for example.
-
-
-
Parameters:
-
-
GroupName
-
-
-
-
-
-
-
-
-
-
-
Private
-
-
-
-
-
- DATABASE:_RegisterGroup (GroupTemplate)
-
-
- Registers new Group Templates within the DATABASE Object.
-
-
-
DestroyGroupType
- string
- Text describing the group to be destroyed. f.e. "Radar Installations", "Ships", "Vehicles", "Command Centers".
-
-
DestroyUnitType
- string
- Text describing the unit types to be destroyed. f.e. "SA-6", "Row Boats", "Tanks", "Tents".
-
-
DestroyGroupPrefixes
- table{string,...}
- Table of Prefixes of the Groups to be destroyed before task is completed.
-
-
DestroyPercentage
- optional number
- defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
-
DestroyGroupType
- string
- String describing the group to be destroyed.
-
-
DestroyUnitType
- string
- String describing the unit to be destroyed.
-
-
DestroyGroupNames
- table{string,...}
- Table of string containing the name of the groups to be destroyed before task is completed.
-
-
DestroyPercentage
- optional number
- defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
-
Message System to display Messages for Clients and Coalitions or All.
-
- Messages are grouped on the display panel per Category to improve readability for the players.
- Messages are shown on the display panel for an amount of seconds, and will then disappear.
- Messages are identified by an ID. The messages with the same ID belonging to the same category will be overwritten if they were still being displayed on the display panel.
- Messages are created with MESSAGE:New().
- Messages are sent to Clients with MESSAGE:ToClient().
- Messages are sent to Coalitions with MESSAGE:ToCoalition().
- Messages are sent to All Players with MESSAGE:ToAll().
- Creates a new MESSAGE object. Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.
-
-
-
Parameters:
-
-
MessageText
- string
- is the text of the Message.
-
-
MessageCategory
- string
- is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability.
-
-
MessageDuration
- number
- is a number in seconds of how long the MESSAGE should be shown on the display panel.
-
-
MessageID
- string
- is a string expressing the ID of the Message.
-
- -- Create a series of new Messages.
--- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
--- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
--- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
--- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
-
-
-
-
-
- MESSAGE:ToClient (Client)
-
-
- Sends a MESSAGE to a Client Group. Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".
-
-
-
- -- Send the 2 messages created with the New method to the Client Group.
--- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
- ClientGroup = Group.getByName( "ClientGroup" )
-
- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
- or
- MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
- MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
- or
- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
- MessageClient1:ToClient( ClientGroup )
- MessageClient2:ToClient( ClientGroup )
- -- Send a message created with the New method to the BLUE coalition.
- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
- or
- MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
- or
- MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
- MessageBLUE:ToBlue()
- -- Send a message created with the New method to the RED coalition.
- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
- or
- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
- or
- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
- MessageRED:ToRed()
-
-
-
-
-
- MESSAGE:ToCoalition (CoalitionSide)
-
-
- Sends a MESSAGE to a Coalition.
-
-
-
Parameters:
-
-
CoalitionSide
- needs to be filled out by the defined structure of the standard scripting engine ???.
-
- -- Send a message created with the New method to the RED coalition.
- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
- or
- MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
- or
- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
- MessageRED:ToCoalition( coalition.side.RED )
- -- Send a message created to all players.
- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
- or
- MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
- or
- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
- MessageAll:ToAll()
-
-
-
-
-
Class MESSAGEQUEUE
-
- MESSAGEQUEUE
-
-
-
- MESSAGEQUEUE:_DisplayMessages ()
-
-
- This function is called automatically by the MESSAGEQUEUE scheduler.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
A MISSION is the main owner of a Mission orchestration within MOOSE .
-
The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc.
- A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.
- This is the main MISSION declaration method. Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
-
-
-
Parameters:
-
-
MissionName
- string
- is the name of the mission. This name will be used to reference the status of each mission by the players.
-
-
MissionPriority
- string
- is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.
-
-
MissionBriefing
- string
- is a string indicating the mission briefing to be shown when a player joins a CLIENT.
-
-
MissionCoalition
- string
- is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
-
- -- Declare a few missions.
-local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
- local Mission = MISSIONSCHEDULER.AddMission( 'Patriots', 'Primary', 'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.', 'Russia' )
- local Mission = MISSIONSCHEDULER.AddMission( 'Package Delivery', 'Operational', 'In order to be in full control of the situation, we need you to deliver a very important package at a secret location. Fly undetected through the NATO defenses and deliver the secret package. The secret agent is located at waypoint 4.', 'Russia' )
- local Mission = MISSIONSCHEDULER.AddMission( 'Rescue General', 'Tactical', 'Our intelligence has received a remote signal behind Gori. We believe it is a very important Russian General that was captured by Georgia. Go out there and rescue him! Ensure you stay out of the battle zone, keep south. Waypoint 4 is the location of our Russian General.', 'Russia' )
- local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
- local Mission = MISSIONSCHEDULER.AddMission( 'SA-6 SAMs', 'Primary', 'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.', 'NATO' )
- local Mission = MISSIONSCHEDULER.AddMission( 'NATO Sling Load', 'Operational', 'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.', 'NATO' )
- local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical', 'In order to be in full control of the situation, we need you to rescue a secret agent from the woods behind enemy lines. Avoid the Russian defenses and rescue the agent. Keep south until Khasuri, and keep your eyes open for any SAM presence. The agent is located at waypoint 4 on your kneeboard.', 'NATO' )
-
-
-
-
-
- MISSION:IsCompleted ()
-
-
- Returns if a Mission has completed.
-
-
-
-
Returns:
-
-
- bool
-
-
-
-
-
-
-
-
-
- MISSION:Completed ()
-
-
- Set a Mission to completed.
-
-
-
-
-
-
-
-
-
-
- MISSION:IsOngoing ()
-
-
- Returns if a Mission is ongoing.
- treturn bool
-
-
-
-
-
-
-
-
-
-
- MISSION:Ongoing ()
-
-
- Set a Mission to ongoing.
-
-
-
-
-
-
-
-
-
-
- MISSION:IsPending ()
-
-
- Returns if a Mission is pending.
- treturn bool
-
-
-
-
-
-
-
-
-
-
- MISSION:Pending ()
-
-
- Set a Mission to pending.
-
-
-
-
-
-
-
-
-
-
- MISSION:IsFailed ()
-
-
- Returns if a Mission has failed.
- treturn bool
-
-
-
-
-
-
-
-
-
-
- MISSION:Failed ()
-
-
- Set a Mission to failed.
-
-
-
-
-
-
-
-
-
-
- MISSION:StatusToClients ()
-
-
- Send the status of the MISSION to all Clients.
-
-
-
-
-
-
-
-
-
-
- MISSION:ReportTrigger ()
-
-
- Handles the reporting. After certain time intervals, a MISSION report MESSAGE will be shown to All Players.
-
-
-
-
-
-
-
-
-
-
- MISSION:ReportToAll ()
-
-
- Report the status of all MISSIONs to all active Clients.
-
-
-
-
-
-
-
-
-
-
- MISSION:AddGoalFunction (GoalFunction)
-
-
- Add a goal function to a MISSION. Goal functions are called when a TASK within a mission has been completed.
-
-
-
Parameters:
-
-
GoalFunction
- function
- is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
-
-
-
-
-
-
-
Usage:
-
-
- PatriotActivation = {
- { "US SAM Patriot Zerti", false },
- { "US SAM Patriot Zegduleti", false },
- { "US SAM Patriot Gvleti", false }
- }
-
- function DeployPatriotTroopsGoal( Mission, Client )
-
-
- -- Check if the cargo is all deployed for mission success.
-for CargoID, CargoData inpairs( Mission._Cargos ) do
- if Group.getByName( CargoData.CargoGroupName ) then
- CargoGroup = Group.getByName( CargoData.CargoGroupName )
- if CargoGroup then
- -- Check if the cargo is ready to activate
- CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) -- The second task is the Deploytask to measure mission success upon
-if CurrentLandingZoneID then
- if PatriotActivation[CurrentLandingZoneID][2] == falsethen
- -- Now check if this is a new Mission Task to be completed...
- trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
- PatriotActivation[CurrentLandingZoneID][2] = true
- MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
- MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
- Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) -- Register Patriot activation as part of mission goal.
-end
- end
- end
- end
- end
- end
-
- local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
- Mission:AddGoalFunction( DeployPatriotTroopsGoal )
-
-
-
-
-
- MISSION:ShowBriefing (Client)
-
-
- Show the briefing of the MISSION to the CLIENT.
-
-
-
- Add a number of Client objects to the Mission.
- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
-
-
-
-
-
- MISSION:FindClient (ClientName)
-
-
- Find a CLIENT object within the MISSION by its ClientName.
-
-
-
Parameters:
-
-
ClientName
- CLIENT
- is a string defining the Client Group as defined within the ME.
-
- -- Seach for Client "Bomber" within the Mission.
-local BomberClient = Mission:FindClient( "Bomber" )
-
-
-
-
-
- MISSION:AddTask (Task, TaskNumber)
-
-
- Register a TASK to be completed within the MISSION. Note that there can be multiple TASKs registered to be completed. Each TASK can be set a certain Goal. The MISSION will not be completed until all Goals are reached.
-
-
-
Parameters:
-
-
Task
- TASK
- is the TASK object. The object must have been instantiated with TASK:New or any of its inherited TASKs.
-
-
TaskNumber
- number
- is the sequence number of the TASK within the MISSION. This number does have to be chronological.
-
- -- Get Task 2 from the Mission.
- Task2 = Mission:GetTask( 2 )
-
-
-
-
-
- MISSION:GetTasks ()
-
-
- Get all the TASKs from the Mission. This function is useful in GoalFunctions.
-
-
-
-
Returns:
-
-
- {TASK,...}
- Structure of TASKS with the TASK number as the key.
-
-
-
-
-
Usage:
-
-
- -- Get Tasks from the Mission.
- Tasks = Mission:GetTasks()
- env.info( "Task 2 Completion = " .. Tasks[2]:GetGoalPercentage() .. "%" )
-
-
-
-
-
Class MISSIONSCHEDULER
-
- The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler. It's workings are considered internal and is automatically created when the Mission.lua file is included.
-
-
-
- MISSIONSCHEDULER.Scheduler ()
-
-
- This is the main MISSIONSCHEDULER Scheduler function. It is considered internal and is automatically created when the Mission.lua file is included.
-
-
-
-
-
-
-
-
-
-
- MISSIONSCHEDULER.Start ()
-
-
- Start the MISSIONSCHEDULER.
-
-
-
-
-
-
-
-
-
-
- MISSIONSCHEDULER.Stop ()
-
-
- Stop the MISSIONSCHEDULER.
-
-
-
-
-
-
-
-
-
-
- MISSIONSCHEDULER.AddMission (Mission)
-
-
- This is the main MISSION declaration method. Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
-
-
-
Parameters:
-
-
Mission
- is the MISSION object instantiated by MISSION:New.
-
-
-
-
Returns:
-
-
- MISSION
-
-
-
-
-
Usage:
-
-
- -- Declare a mission.
- Mission = MISSION:New( 'Russia Transport Troops SA-6',
- 'Operational',
- 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
- 'Russia' )
- MISSIONSCHEDULER:AddMission( Mission )
- Remove a MISSION from the MISSIONSCHEDULER.
-
-
-
Parameters:
-
-
MissionName
- is the name of the MISSION given at declaration using AddMission.
-
-
-
-
-
-
-
Usage:
-
-
- -- Declare a mission.
- Mission = MISSION:New( 'Russia Transport Troops SA-6',
- 'Operational',
- 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
- 'Russia' )
- MISSIONSCHEDULER:AddMission( Mission )
-
- -- Now remove the Mission.
- MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )
-
-
-
-
-
- MISSIONSCHEDULER.FindMission (MissionName)
-
-
- Find a MISSION within the MISSIONSCHEDULER.
-
-
-
Parameters:
-
-
MissionName
- is the name of the MISSION given at declaration using AddMission.
-
-
-
-
Returns:
-
-
- MISSION
-
-
-
-
-
Usage:
-
-
- -- Declare a mission.
- Mission = MISSION:New( 'Russia Transport Troops SA-6',
- 'Operational',
- 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
- 'Russia' )
- MISSIONSCHEDULER:AddMission( Mission )
-
- -- Now find the Mission.
- MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )
-
-
-
-
-
- MISSIONSCHEDULER.ReportMenu ()
-
-
- Enables a MENU option in the communications menu under F10 to control the status of the active missions.
- This function should be called only once when starting the MISSIONSCHEDULER.
-
-
-
-
-
-
-
-
-
-
- MISSIONSCHEDULER:TimeShow ()
-
-
- Show the remaining mission time.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
Limit the simultaneous movement of Groups within a running Mission.
-
- This module is defined to improve the performance in missions, and to bring additional realism for GROUND vehicles.
- Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if
- the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units
- on defined intervals (currently every minute).
This function is called automatically by the MOVEMENT scheduler.
-
-
-
-
-
-
-
-
Methods
-
-
-
-
- MOVEMENT:New (MovePrefixes, MoveMaximum)
-
-
- Creates the main object which is handling the GROUND forces movement.
-
-
-
Parameters:
-
-
MovePrefixes
- table{string,...} or string
- is a table of the Prefixes (names) of the GROUND Groups that need to be controlled by the MOVEMENT Object.
-
-
MoveMaximum
- number
- is a number that defines the maximum amount of GROUND Units to be moving during one minute.
-
- -- Limit the amount of simultaneous moving units on the ground to prevent lag.
- Movement_US_Platoons = MOVEMENT:New( { 'US Tank Platoon Left', 'US Tank Platoon Middle', 'US Tank Platoon Right', 'US CH-47D Troops' }, 15 )
-
-
-
-
-
- MOVEMENT:ScheduleStart ()
-
-
- Call this function to start the MOVEMENT scheduling.
-
-
-
-
-
-
-
-
-
-
- MOVEMENT:ScheduleStop ()
-
-
- Call this function to stop the MOVEMENT scheduling.
-
-
-
-
-
-
-
-
-
-
- MOVEMENT:OnBirth (event)
-
-
- Captures the birth events when new Units were spawned.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- MOVEMENT:OnDeadOrCrash (event)
-
-
- Captures the Dead or Crash events when Units crash or are destroyed.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- MOVEMENT:_Scheduler ()
-
-
- This function is called automatically by the MOVEMENT scheduler. A new function is scheduled when MoveScheduled is true.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
Detects if an SA site was shot with an anti radiation missile.
-
-
-
-
-
-
-
-
Methods
-
-
-
-
- SEAD:New (SEADGroupPrefixes)
-
-
- Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.
- When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions...
- Chances are big that the missile will miss.
-
-
-
Parameters:
-
-
SEADGroupPrefixes
- table{string,...} or string
- which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken.
-
Will return the SpawnGroupName either with with a specific count number or without any count.
-
-
-
-
-
-
-
-
Private
-
-
-
-
-
- SPAWN:_GetGroupCategoryID (SpawnPrefix)
-
-
- Gets the CategoryID of the Group with the given SpawnPrefix
-
-
-
Parameters:
-
-
SpawnPrefix
-
-
-
-
-
-
-
-
-
-
-
- SPAWN:_GetGroupCoalitionID (SpawnPrefix)
-
-
- Gets the CoalitionID of the Group with the given SpawnPrefix
-
-
-
Parameters:
-
-
SpawnPrefix
-
-
-
-
-
-
-
-
-
-
-
- SPAWN:_GetGroupCountryID (SpawnPrefix)
-
-
- Gets the CountryID of the Group with the given SpawnPrefix
-
-
-
Parameters:
-
-
SpawnPrefix
-
-
-
-
-
-
-
-
-
-
-
- SPAWN:_GetTemplate (SpawnTemplatePrefix)
-
-
- 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.
-
-
-
- Will detect AIR Units taking off... When the event takes place, the SPAWNed Group is registered as airborne...
- This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- SPAWN:OnLand (event)
-
-
- Will detect AIR Units landing... When the event takes place, the SPAWNed Group is registered as landed.
- This is needed to ensure that Re-SPAWNing is only done for landed AIR Groups.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
- SPAWN:OnEngineShutDown (event)
-
-
- Will detect AIR Units shutting down their engines ...
- When the event takes place, and the method RepeatOnEngineShutDown was called, the SPAWNed Group will Re-SPAWN.
- But only when the Unit was registered to have landed.
-
-
-
- This function is called automatically by the Spawning scheduler.
- It is the internal worker method SPAWNing new Groups on the defined time intervals.
-
-
-
-
-
-
-
-
-
-
Public
-
-
-
-
-
- SPAWN:New (SpawnTemplatePrefix)
-
-
- Creates the main object to spawn a Group defined in the DCS ME.
- Spawned Groups and Units will follow the following naming convention within the DCS World run-time environment:
- Groups will have the name SpawnTemplatePrefix#ggg, where ggg is a counter from 0 to 999 for each new spawned Group.
- Units will have the name SpawnTemplatePrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned Unit belonging to that Group.
-
-
-
Parameters:
-
-
SpawnTemplatePrefix
- string
- is the name of the Group in the ME that defines the Template. That Group must have the flag "Late Activation" set. Note that this SpawnTemplatePrefix name should not contain any # character.
-
- -- NATO helicopters engaging in the battle field.
- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
-
-
-
-
-
- SPAWN:NewWithAlias (SpawnTemplatePrefix)
-
-
- Creates the main object to spawn a Group defined in the DCS ME.
- Spawned Groups and Units will follow the following naming convention within the DCS World run-time environment:
- Groups will have the name SpawnTemplatePrefix#ggg, where ggg is a counter from 0 to 999 for each new spawned Group.
- Units will have the name SpawnTemplatePrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned Unit belonging to that Group.
-
-
-
Parameters:
-
-
SpawnTemplatePrefix
- string
- is the name of the Group in the ME that defines the Template. That Group must have the flag "Late Activation" set. Note that this SpawnTemplatePrefix name should not contain any # character.
-
- Limits the Maximum amount of Units to be alive, and the maximum amount of Groups to be SPAWNed within the DCS World run-time environment.
- Note that this method is exceptionally important to balance the amount of Units alive within the DCSRTE and the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units.
- If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this function should be used...
-
-
-
Parameters:
-
-
SpawnMaxGroupsAlive
- number
- is the Maximum amount of Units to be alive. When there are more Units alive in the DCSRTE of SpawnTemplatePrefix, then no new SPAWN will happen of the Group, until some of these Units will be destroyed.
-
-
SpawnMaxGroups
- number
- is the Maximum amount of Groups that can be SPAWNed from SpawnTemplatePrefix. When there are more Groups alive in the DCSRTE of SpawnTemplatePrefix, then no more SPAWNs will happen of the Group. This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area.
- This parameter accepts the value 0, which expresses no Group count limits.
-
- -- NATO helicopters engaging in the battle field.
--- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
--- There will be maximum 24 groups SPAWNed during the whole mission lifetime.
- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Limit( 2, 24 )
- Randomizes a defined route of the Template Group in the ME when the Group is Spawned. This is very useful to define extra variation in the DCS World run-time environment of the behaviour of Groups like Ground Units, Ships, Planes, Helicopters.
-
-
-
Parameters:
-
-
SpawnStartPoint
- number
- is the waypoint where the randomization begins. Note that the StartPoint = 0 equals the point where the Group is Spawned. This parameter is useful to avoid randomization to start from the first waypoint, but a bit further down the route...
-
-
SpawnEndPoint
- number
- is the waypoint where the randomization ends. this parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.
-
-
SpawnRadius
- number
- is the radius in meters, that defines the concentric circle in which the randomization of the new waypoint will take place, with the original waypoint located in the middle...
-
- -- NATO helicopters engaging in the battle field.
--- The KA-50 has waypoints SP, 1, 2, 3, 4, DP.
--- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new ${SPAWN} of the helicopter.
--- The randomization of waypoint 2 and 3 will take place within a diameter of 4000 meters.
- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):RandomizeRoute( 2, 2, 2000 )
- This function is rather complicated to understand. But I'll try to explain...
- This function becomes useful when you need to SPAWN random types of Groups defined within the ME, but they all need to follow the same Template route and have the same SpawnTemplatePrefix name, then this method becomes very useful.
-
-
-
Parameters:
-
-
SpawnTemplatePrefixTable
- table{string,...}
- is a table with the names of the Groups defined within the ME (with late activatio on), from which on a new SPAWN of SpawnTemplatePrefix (the main Group name), a NEW Group will be choosen as the Group to be SPAWNed.
- In other words, this method randomizes between a defined set of Groups the Group to be SPAWNed for each new SPAWN.
-
- -- NATO Tank Platoons invading Gori.
--- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be SPAWNed for the
--- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
--- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
--- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be SPAWNed during the whole mission.
- Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5',
- 'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10',
- 'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
- Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
- Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
- Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
-
-
-
-
-
- SPAWN:Repeat ()
-
-
- When a Group got SPAWNed, it has a life within the DCSRTE. For planes and helicopters, when these Units go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the DCSRTE.
- This function is used to Re-Spawn automatically (so no extra call is needed anymore) the same Group after it landed. This will enable a SPAWNed group to be Re-SPAWNed after it lands, until it is destroyed...
- Note: When the Group is respawned, it will ReSpawn at the original airbase where it took off. So ensure that the paths for Groups that ReSpawn, always return to the original airbase.
-
-
-
-
- -- Define an array of Groups within Zone "Start".
- Spawn_BE_Ground = SPAWN:New( 'BE Ground' ):Limit( 2, 24 ):Visible( ZONE:New( "Start" ), 90, "Diamond", 10, 100, 50 )
-
-
-
-
-
- SPAWN:Spawn ()
-
-
- Will SPAWN a Group whenever you want to do this.
- Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
- Uses DATABASE global object defined in MOOSE.
-
-
-
-
- Will Re-SPAWN a Group based on a given GroupName. The GroupName must be a group that is already alive within the DCSRTE and should have a Group Template defined in the ME (with Late Activation flag on).
- Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
-
-
-
-
-
- SPAWN
- Uses _Database global object defined in MOOSE.
-
-
-
-
-
-
-
-
- SPAWN:SpawnWithIndex (SpawnIndex)
-
-
- Will SPAWN a Group with a specified index number whenever you want to do this.
- Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
- Uses DATABASE global object defined in MOOSE.
-
-
-
Parameters:
-
-
SpawnIndex
-
-
-
-
-
Returns:
-
-
- GROUP
- The GROUP that was spawned. You can use this group for further actions.
-
-
-
-
-
-
- SPAWNs a new Group within varying time intervals. This is useful if you want to have continuity within your missions of certain (AI) Groups to be present (alive) within your missions.
-
-
-
Parameters:
-
-
SpawnTime
- number
- is the time interval defined in seconds between each new SPAWN of new Groups.
-
-
SpawnTimeVariation
- number
- is the variation to be applied on the defined time interval between each new SPAWN. The variation is defined as a value between 0 and 1, which expresses the %-tage of variation to be applied as the low and high time interval boundaries. Between these boundaries a new time interval will be applied. See usage.
-
- -- NATO helicopters engaging in the battle field.
--- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
--- The time variation in this case will be between 450 seconds and 750 seconds.
--- This is calculated as follows:
--- Low limit: 600 * ( 1 - 0.5 / 2 ) = 450
--- High limit: 600 * ( 1 + 0.5 / 2 ) = 750
--- Between these two values, a random amount of seconds will be choosen for each new SPAWN of the helicopters.
- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
-
-
-
-
- SPAWN:ScheduleStart ()
-
-
- Will start the SPAWNing timers.
- This function is called automatically when ??? is called.
-
-
-
-
-
-
-
-
-
-
- SPAWN:ScheduleStop ()
-
-
- Will stop the scheduled SPAWNing activity.
-
-
-
-
-
-
-
-
-
-
- SPAWN:UnControlled ()
-
-
- Will SPAWN a Group whenever you want to do this, but for AIR Groups only to be applied, and will SPAWN the Group in Uncontrolled mode...
- This will be similar to the Uncontrolled flag setting in the ME.
-
-
-
-
- Will SPAWN a Group from a Hosting UNIT. This function is mostly advisable to be used if you want to simulate SPAWNing from air units, like helicopters, which are dropping infantry into a defined Landing Zone.
- Note that each point in the route assigned to the spawning GROUP is reset to the Point of the spawn.
- You can use the returned GROUP to further define the route to be followed.
-
-
-
Parameters:
-
-
HostUnit
- UNIT
- is the AIR unit or GROUND unit dropping or unloading the Spawn group.
-
- When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
- When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.
-
-
-
Parameters:
-
-
SignalUnitNames
- table or string
- Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
-
-
SignalHeight
- number
- Altitude that the Signal should be fired...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2016-03-14 10:50:59
-
This class can be used to KEEP airbases or farps clean (note the word keep here, it cannot destroy units that are already dead).
- The CleanUp class works with 2 validation logic compontents:
- * EVENT validation: An event detection to intercept HIT events, upon which a validation of units CLEANUP CONDITIONS are applied. Once a unit is HIT, it is registered in a TIMED validation logic.
- * TIMED validation: Units registered in a TIMED validation, are repeatedly validated of certain CLEANUP CONDITIONS.
- If the CLEANUP CONDITIONS apply, the unit will be destroyed, and the group will be destroyed.
- * It does not clean the zone, it tries to keep it clean by destroying units or groups before they explode or crash into the ground.
- * For airplanes or helicopters, when in the CleanUpZone:
- ** When the unit is airborne, and it is HIT ( by a weapon or a crash of another unit ), CLEANUP will destroy the unit or group when the health of the unit reaches an AIRBORNE HEALTH LIMIT.
-
-
-When the unit is HIT, it will register the unit for further repeated health monitoring, until:
-
-
-
* the unit's health is beyond the an AIRBORNE HEALTH LIMIT
- * until the height of the unit is below the safety zone to prevent it from crashing.
- * When the unit is not airborne, and it is HIT, it will be registered
- * When the unit is
At the defined time interval, CleanUp the Groups within the CleanUpList.
-
-
-
-
-
-
-
-
Functions
-
-
-
-
- CLEANUP:New (ZoneNames, TimeInterval)
-
-
- Creates the main object which is handling the cleaning of the debris within the given Zone Names.
-
-
-
Parameters:
-
-
ZoneNames
- table{string,...} or string
- which is a table of zone names where the debris should be cleaned. Also a single string can be passed with one zone name.
-
-
TimeInterval
- optional number
- is the interval in seconds when the clean activity takes place. The default is 300 seconds, thus every 5 minutes.
-
- This function is required, and used a non-documented feature. The function world.onEvent will loop through all registered event handlers with the event structure given.
- This is required to be done because the method Group.destroy(Group) does not generate the SEVENTDEAD through all the registered event handlers.
- As such, the other classes using the SEVENTDEAD will get confused if this event is not catched properly...
-
-
-
Parameters:
-
-
CleanUpUnit
-
-
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_CheckLife (the)
-
-
- Measures the life of a Unit using the LifeLimit treshold. Returns true if Group has a life lower than the treshold, false if the life is still okay.
-
-
-
Parameters:
-
-
the
- Group
- Group to be cleaned.
-
-
-
-
Returns:
-
-
- bool
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_CleanUnit (CleanUpUnit)
-
-
- Cleans a Group from the DCSRTE.
-
-
-
Parameters:
-
-
CleanUpUnit
-
-
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_EventAddForCleanUp (event)
-
-
- Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given ZoneNames. If this is the case, add the Group to the CLEANUP List.
-
-
-
Parameters:
-
-
event
-
-
-
-
-
-
-
-
-
-
-
-
-
- CLEANUP:_Scheduler ()
-
-
- At the defined time interval, CleanUp the Groups within the CleanUpList.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2015-02-11 11:12:10
-
MOOSE is a Mission Object Oriented Scripting Environment, and is meant for mission designers and mission hosters.
-It allows (will allow) to quickly setup complex missions using pre-scripted scenarios.
-In order to run missions using this framework, you will need to install the framework within your Eagle Dynamics program files folder.
-
-
The goal of MOOSE is to allow mission designers to enhance their scripting with mission orchestration objects, which can be instantiated from defined classes within the framework.
-This will allow to write mission scripts with minimal code embedded. Of course, the richness of the framework will determine the richness of the misson scenarios.
-We can expect that MOOSE will evolve over time, as more missions will be designed within the framework.
-
-
-
Currently supported functions
-
MOOSE contains currently the following mission design functions. The words in CAPITAL letters document the classes that can be used within MOOSE to accomplish these functions.
-
-
-
SPAWN Dynamic spawning and respawning of Groups with related functions.
-
MOVEMENT Keeps control over the amount of units driving around the battlefield simultaneously.
-
CLEANUP Clean-Up zones with air units that crashed. Can be used to prevent airports blocking air traffic and ground control operations due to crashed units near the airfield.
-
SEAD Enables the defenses for SAM sites. Mobile SAMs will evade fired anti-radiation missiles by shutting down their radars (for a while). If they are mobile, they will also drive away.
-
MISSION Create Taskforces or Missions within a DCS Mission. A mission will consist of TASKs, and CLIENTs.
-
TASK Add tasks for the mission. There are many different tasks that can be given, by using the classes derived from TASK.
The installation of the MOOSE framework is straightforward.
-
-
-
Extract MOOSE.zip. You can do this quickly by right clicking the MOOSE.zip file, and select "Extract All".
-
The extraction will add a directory within the Scripts directory of the Eagle Dynamics DCS world installation.
- Example, the Scripts directory of my DCS World installation folder is C:\Program Files\Eagle Dynamics\DCS World\Scripts
-
Browse within the new MOOSE directory to the DCS_Script directory and run Install.bat as an administrator.
- This will make a backup of the missionScripting.lua file and replace this with a new one.
-
-
-
And you're done.
-
-
-
What has changed?
-
-
Not much. The missionscripting.lua file has been enhanced with the following code:
This code allows for the inclusion of the MOOSE framework, and this now becomes part of your DCS World Simulation Engine.
-Missions designed with the MOOSE framework will now run.
-
-
-
-
-
-
-generated by LDoc 1.4.3
-Last updated 2015-01-29 21:06:10
-
string :
+DestroyGroupType Text describing the group to be destroyed. f.e. "Radar Installations", "Ships", "Vehicles", "Command Centers".
+
+
+
+
+
string :
+DestroyUnitType Text describing the unit types to be destroyed. f.e. "SA-6", "Row Boats", "Tanks", "Tents".
+
+
+
+
+
table :
+string,...} DestroyGroupPrefixes Table of Prefixes of the Groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
string :
+DestroyGroupType String describing the group to be destroyed.
+
+
+
+
+
string :
+DestroyUnitType String describing the unit to be destroyed.
+
+
+
+
+
table :
+string,...} DestroyGroupNames Table of string containing the name of the groups to be destroyed before task is completed.
+
+
+
+
+
? :
+umber DestroyPercentage defines the %-tage that needs to be destroyed to achieve mission success. eg. If in the Group there are 10 units, then a value of 75 would require 8 units to be destroyed from the Group to complete the TASK.
+-@return DESTROYGROUPSTASK
Creates a new DATABASE Object to administer the Groups defined and alive within the DCSRTE.
+
+
Return value
+
+
+
DATABASE
+
+
Usage:
+
-- Define a new DATABASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
+DBObject = DATABASE:New()
This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
+SpawnCountryID, SpawnCategoryID
+This method is used by the SPAWN class.
A MISSION is the main owner of a Mission orchestration within MOOSE .
+
+
+
The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc.
+A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.
_TransportExecuteStage: Defines the different stages of Transport unload/load execution. This table is internal and is used to control the validity of Transport load/unload timing.
Register a new CLIENT to participate within the mission.
+
+
Parameters
+
+
+
+
CLIENT :
+Client is the CLIENT object. The object must have been instantiated with CLIENT.
+
+
+
+
+
self :
+
+
+
+
+
Client :
+
+
+
+
Return value
+
+
+
CLIENT
+
+
Usage:
+
Add a number of Client objects to the Mission.
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Goal functions are called when a TASK within a mission has been completed.
+
+
Parameters
+
+
+
+
function :
+GoalFunction is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
+
+
+
+
+
self :
+
+
+
+
+
GoalFunction :
+
+
+
+
Usage:
+
PatriotActivation = {
+ { "US SAM Patriot Zerti", false },
+ { "US SAM Patriot Zegduleti", false },
+ { "US SAM Patriot Gvleti", false }
+ }
+
+ function DeployPatriotTroopsGoal( Mission, Client )
+
+
+ -- Check if the cargo is all deployed for mission success.
+ for CargoID, CargoData in pairs( Mission._Cargos ) do
+ if Group.getByName( CargoData.CargoGroupName ) then
+ CargoGroup = Group.getByName( CargoData.CargoGroupName )
+ if CargoGroup then
+ -- Check if the cargo is ready to activate
+ CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) -- The second task is the Deploytask to measure mission success upon
+ if CurrentLandingZoneID then
+ if PatriotActivation[CurrentLandingZoneID][2] == false then
+ -- Now check if this is a new Mission Task to be completed...
+ trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
+ PatriotActivation[CurrentLandingZoneID][2] = true
+ MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
+ MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
+ Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) -- Register Patriot activation as part of mission goal.
+ end
+ end
+ end
+ end
+ end
+ end
+
+ local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+ Mission:AddGoalFunction( DeployPatriotTroopsGoal )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameters
+
+
+
+
string :
+MissionName is the name of the mission. This name will be used to reference the status of each mission by the players.
+
+
+
+
+
string :
+MissionPriority is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.
+
+
+
+
+
string :
+MissionBriefing is a string indicating the mission briefing to be shown when a player joins a CLIENT.
+
+
+
+
+
string :
+MissionCoalition is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
+
+
+
+
+
self :
+
+
+
+
+
MissionName :
+
+
+
+
+
MissionPriority :
+
+
+
+
+
MissionBriefing :
+
+
+
+
+
MissionCoalition :
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a few missions.
+local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Patriots', 'Primary', 'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Package Delivery', 'Operational', 'In order to be in full control of the situation, we need you to deliver a very important package at a secret location. Fly undetected through the NATO defenses and deliver the secret package. The secret agent is located at waypoint 4.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue General', 'Tactical', 'Our intelligence has received a remote signal behind Gori. We believe it is a very important Russian General that was captured by Georgia. Go out there and rescue him! Ensure you stay out of the battle zone, keep south. Waypoint 4 is the location of our Russian General.', 'Russia' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'SA-6 SAMs', 'Primary', 'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'NATO Sling Load', 'Operational', 'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.', 'NATO' )
+local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical', 'In order to be in full control of the situation, we need you to rescue a secret agent from the woods behind enemy lines. Avoid the Russian defenses and rescue the agent. Keep south until Khasuri, and keep your eyes open for any SAM presence. The agent is located at waypoint 4 on your kneeboard.', 'NATO' )
Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
+
+
Parameter
+
+
+
+
Mission :
+is the MISSION object instantiated by MISSION.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
+-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Return value
+
+
+
MISSION
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now find the Mission.
+MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )
MissionName :
+is the name of the MISSION given at declaration using AddMission.
+
+
+
+
Usage:
+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6',
+ 'Operational',
+ 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.',
+ 'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now remove the Mission.
+MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )
Limit the simultaneous movement of Groups within a running Mission.
+
+
+
This module is defined to improve the performance in missions, and to bring additional realism for GROUND vehicles.
+Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if
+the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units
+on defined intervals (currently every minute).
Message System to display Messages for Clients and Coalitions or All.
+
+
+
Messages are grouped on the display panel per Category to improve readability for the players.
+Messages are shown on the display panel for an amount of seconds, and will then disappear.
+Messages are identified by an ID. The messages with the same ID belonging to the same category will be overwritten if they were still being displayed on the display panel.
+Messages are created with MESSAGE:New().
+Messages are sent to Clients with MESSAGE:ToClient().
+Messages are sent to Coalitions with MESSAGE:ToCoalition().
+Messages are sent to All Players with MESSAGE:ToAll().
Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.
+
+
Parameters
+
+
+
+
#string MessageText :
+is the text of the Message.
+
+
+
+
+
#string MessageCategory :
+is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability.
+
+
+
+
+
#number MessageDuration :
+is a number in seconds of how long the MESSAGE should be shown on the display panel.
+
+
+
+
+
#string MessageID :
+is a string expressing the ID of the Message.
-- Create a series of new Messages.
+-- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
+-- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
-- Send a message created to all players.
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageAll:ToAll()
-- Send a message created with the @{New} method to the BLUE coalition.
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageBLUE:ToBlue()
-- Send the 2 messages created with the @{New} method to the Client Group.
+-- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
+ClientGroup = Group.getByName( "ClientGroup" )
+
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
+MessageClient1:ToClient( ClientGroup )
+MessageClient2:ToClient( ClientGroup )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToCoalition( coalition.side.RED )
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToRed()
_TransportStage: Defines the different stages of which of transport missions can be in. This table is internal and is used to control the sequence of messages, actions and flow.
Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.
+
+
+
When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions...
+Chances are big that the missile will miss.
+
+
Parameters
+
+
+
+
table :
+string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken.
The SPAWN class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
+For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the "Spawn Template" of the SPAWN object.
+A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.
+
+
Within the SPAWN object, there is an internal index that keeps track of which group from the internal group list was spawned.
+When new groups get spawned by using the SPAWN functions (see below), it will be validated whether the Limits (SPAWN.Limit) of the SPAWN object are not reached.
+When all is valid, a new group will be created by the spawning methods, and the internal index will be increased with 1.
+
+
Regarding the name of new spawned groups, a SpawnPrefix will be assigned for each new group created.
+If you want to have the Spawn Template name to be used as the SpawnPrefix name, use the SPAWN.New constructor.
+However, when the SPAWN.NewWithAlias constructor was used, the Alias name will define the SpawnPrefix name.
+Groups will follow the following naming structure when spawned at run-time:
+
+
+
Spawned groups will have the name SpawnPrefix#ggg, where ggg is a counter from 0 to 999.
+
Spawned units will have the name SpawnPrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned unit belonging to the group.
+
+
+
Some additional notes that need to be remembered:
+
+
+
Templates are actually groups defined within the mission editor, with the flag "Late Activation" set. As such, these groups are never used within the mission, but are used by the #SPAWN module.
+
It is important to defined BEFORE you spawn new groups, a proper initialization of the SPAWN instance is done with the options you want to use.
+
When designing a mission, NEVER name groups using a "#" within the name of the group Spawn Template(s), or the SPAWN module logic won't work anymore.
SPAWN.New: Creates a new SPAWN object taking the name of the group that functions as the Template.
+
+
+
It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned.
+The initialization functions will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons.
+So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.
+
+
+
SPAWN object initialization methods:
+
A spawn object will behave differently based on the usage of initialization methods:
+
SPAWN.Limit: Limits the amount of groups that can be alive at the same time and that can be dynamically spawned.
SPAWN.RandomizeTemplate: Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined.
Note that SPAWN.Spawn and SPAWN.ReSpawn return a 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.
+
+
+
SPAWN object cleaning:
+
+ Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive.
+ In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't,
+ and it may occur that no new groups are or can be spawned as limits are reached.
+ To prevent this, a SPAWN.CleanUp initialization method has been defined that will silently monitor the status of each spawned group.
+ Once a group has a velocity = 0, and has been waiting for a defined interval, that group will be cleaned or removed from run-time.
+ There is a catch however :-) If a damaged group has returned to an airbase within the coalition, that group will not be considered as "lost"...
+ In such a case, when the inactive group is cleaned, a new group will Re-spawned automatically.
+ This models AI that has succesfully returned to their airbase, to restart their combat activities.
+ Check the SPAWN.CleanUp for further info.
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
CleanUp groups when they are still alive, but inactive.
+
+
+
When groups are still alive and have become inactive due to damage and are unable to contribute anything, then this group will be removed at defined intervals in seconds.
+
+
Parameter
+
+
+
+
#string SpawnCleanUpInterval :
+The interval to check for inactive groups within seconds.
Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.
+
+
+
Note that this method is exceptionally important to balance the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units.
+If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this function should be used...
+When a SPAWN.New is executed and the limit of the amount of units alive is reached, then no new spawn will happen of the group, until some of these units of the spawn object will be destroyed.
+
+
Parameters
+
+
+
+
#number SpawnMaxUnitsAlive :
+The maximum amount of units that can be alive at runtime.
+
+
+
+
+
#number SpawnMaxGroups :
+The maximum amount of groups that can be spawned. When the limit is reached, then no more actual spawns will happen of the group.
+This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area.
+This parameter accepts the value 0, which defines that there are no maximum group limits, but there are limits on the maximum of units that can be alive at the same time.
-- NATO helicopters engaging in the battle field.
+-- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
+-- There will be maximum 24 groups spawned during the whole mission lifetime.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Limit( 2, 24 )
Creates the main object to spawn a GROUP defined in the DCS ME.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefix :
+is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
+
local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.
-- NATO helicopters engaging in the battle field.
+Spawn_BE_KA50 = SPAWN:NewWithAlias( 'BE KA-50@RAMP-Ground Defense', 'Helicopter Attacking a City' )
+
local PlaneWithAlias = SPAWN:NewWithAlias( "Plane", "Bomber" ) -- Creates a new local variable that can instantiate new planes with the name "Bomber#ddd" using the template "Plane" as defined within the ME.
Randomizes the defined route of the SpawnTemplatePrefix group in the ME.
+
+
+
This is very useful to define extra variation of the behaviour of groups.
+
+
Parameters
+
+
+
+
#number SpawnStartPoint :
+is the waypoint where the randomization begins.
+Note that the StartPoint = 0 equaling the point where the group is spawned.
+
+
+
+
+
#number SpawnEndPoint :
+is the waypoint where the randomization ends counting backwards.
+This parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.
+
+
+
+
+
#number SpawnRadius :
+is the radius in meters in which the randomization of the new waypoints, with the original waypoint of the original template located in the middle ...
-- NATO helicopters engaging in the battle field.
+-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP).
+-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
+-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):RandomizeRoute( 2, 2, 2000 )
This function is rather complicated to understand.
+
+
+
But I'll try to explain.
+This function becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
+but they will all follow the same Template route and have the same prefix name.
+In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.
+
+
Parameter
+
+
+
+
#string SpawnTemplatePrefixTable :
+A table with the names of the groups defined within the mission editor, from which one will be choosen when a new group will be spawned.
-- NATO Tank Platoons invading Gori.
+-- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be spawned for the
+-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
+-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
+-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
+Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5',
+ 'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10',
+ 'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
+Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.
+
+
+
This function is used to re-spawn automatically (so no extra call is needed anymore) the same group after it has landed.
+This will enable a spawned group to be re-spawned after it lands, until it is destroyed...
+Note: When the group is respawned, it will re-spawn from the original airbase where it took off.
+So ensure that the routes for groups that respawn, always return to the original airbase, or players may get confused ...
This function is mostly advisable to be used if you want to simulate spawning from air units, like helicopters, which are dropping infantry into a defined Landing Zone.
+Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
+You can use the returned group to further define the route to be followed.
+
+
Parameters
+
+
+
+
Unit#UNIT HostUnit :
+The air or ground unit dropping or unloading the group.
+
+
+
+
+
#number OuterRadius :
+The outer radius in meters where the new group will be spawned.
+
+
+
+
+
#number InnerRadius :
+The inner radius in meters where the new group will NOT be spawned.
+
+
+
+
+
#number SpawnIndex :
+(Optional) The index which group to spawn within the given zone.
This is useful if you want to have continuity within your missions of certain (AI) groups to be present (alive) within your missions.
+
+
Parameters
+
+
+
+
#number SpawnTime :
+The time interval defined in seconds between each new spawn of new groups.
+
+
+
+
+
#number SpawnTimeVariation :
+The variation to be applied on the defined time interval between each new spawn.
+The variation is a number between 0 and 1, representing the %-tage of variation to be applied on the time interval.
-- NATO helicopters engaging in the battle field.
+-- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
+-- The time variation in this case will be between 450 seconds and 750 seconds.
+-- This is calculated as follows:
+-- Low limit: 600 * ( 1 - 0.5 / 2 ) = 450
+-- High limit: 600 * ( 1 + 0.5 / 2 ) = 750
+-- Between these two values, a random amount of seconds will be choosen for each new spawn of the helicopters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
When the event takes place, the spawned Group is registered as airborne...
+This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.
When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...
When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.
+
+
Parameters
+
+
+
+
table :
+string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.
+
+
+
+
+
number :
+SignalHeight Altitude that the Signal should be fired...