diff --git a/Moose Development/Moose/Airbase.lua b/Moose Development/Moose/Airbase.lua index 970e8ddfa..ec1e47e21 100644 --- a/Moose Development/Moose/Airbase.lua +++ b/Moose Development/Moose/Airbase.lua @@ -41,9 +41,9 @@ -- @module Airbase -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The AIRBASE class -- @type AIRBASE diff --git a/Moose Development/Moose/Base.lua b/Moose Development/Moose/Base.lua index 47045deed..1d91baca7 100644 --- a/Moose Development/Moose/Base.lua +++ b/Moose Development/Moose/Base.lua @@ -53,7 +53,7 @@ -- @module Base -- @author FlightControl -Include.File( "Routines" ) + local _TraceOn = true local _TraceLevel = 1 diff --git a/Moose Development/Moose/Cargo.lua b/Moose Development/Moose/Cargo.lua index ea54dde1b..33c4461e1 100644 --- a/Moose Development/Moose/Cargo.lua +++ b/Moose Development/Moose/Cargo.lua @@ -1,10 +1,10 @@ --- CARGO Classes -- @module CARGO -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Scheduler" ) + + + + --- Clients are those Groups defined within the Mission Editor that have the skillset defined as "Client" or "Player". diff --git a/Moose Development/Moose/CleanUp.lua b/Moose Development/Moose/CleanUp.lua index 936318ef1..71554252b 100644 --- a/Moose Development/Moose/CleanUp.lua +++ b/Moose Development/Moose/CleanUp.lua @@ -2,11 +2,11 @@ -- @module CleanUp -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The CLEANUP class. -- @type CLEANUP @@ -58,7 +58,6 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName ) self:F( { GroupObject, CleanUpGroupName } ) if GroupObject then -- and GroupObject:isExist() then - --MESSAGE:New( "Destroy Group " .. CleanUpGroupName, CleanUpGroupName, 1, CleanUpGroupName ):ToAll() trigger.action.deactivateGroup(GroupObject) self:T( { "GroupObject Destroyed", GroupObject } ) end @@ -72,7 +71,6 @@ function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName ) self:F( { CleanUpUnit, CleanUpUnitName } ) if CleanUpUnit then - --MESSAGE:New( "Destroy " .. CleanUpUnitName, CleanUpUnitName, 1, CleanUpUnitName ):ToAll() local CleanUpGroup = Unit.getGroup(CleanUpUnit) -- TODO Client bug in 1.5.3 if CleanUpGroup and CleanUpGroup:isExist() then @@ -142,7 +140,6 @@ function CLEANUP:_EventCrash( Event ) self:F( { Event } ) --TODO: This stuff is not working due to a DCS bug. Burning units cannot be destroyed. - --MESSAGE:New( "Crash ", "Crash", 10, "Crash" ):ToAll() -- self:T("before getGroup") -- local _grp = Unit.getGroup(event.initiator)-- Identify the group that fired -- self:T("after getGroup") @@ -277,7 +274,6 @@ function CLEANUP:_CleanUpScheduler() --self:T( CleanUpUnitVec2 ) local CleanUpSurfaceType = land.getSurfaceType(CleanUpUnitVec2) --self:T( CleanUpSurfaceType ) - --MESSAGE:New( "Surface " .. CleanUpUnitName .. " = " .. CleanUpSurfaceTypeText[CleanUpSurfaceType], CleanUpUnitName, 10, CleanUpUnitName ):ToAll() if CleanUpUnit and CleanUpUnit:getLife() <= CleanUpUnit:getLife0() * 0.95 then if CleanUpSurfaceType == land.SurfaceType.RUNWAY then @@ -309,7 +305,6 @@ function CLEANUP:_CleanUpScheduler() else UnitData.CleanUpTime = timer.getTime() UnitData.CleanUpMoved = true - --MESSAGE:New( "Moved " .. CleanUpUnitName, CleanUpUnitName, 10, CleanUpUnitName ):ToAll() end end diff --git a/Moose Development/Moose/Client.lua b/Moose Development/Moose/Client.lua index 4326d11cf..690d4ef8e 100644 --- a/Moose Development/Moose/Client.lua +++ b/Moose Development/Moose/Client.lua @@ -37,10 +37,10 @@ -- @module Client -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Cargo" ) -Include.File( "Message" ) + + + + --- The CLIENT class @@ -462,16 +462,16 @@ function CLIENT:Message( Message, MessageDuration, MessageId, MessageCategory, M else self.Messages[MessageId].MessageInterval = MessageInterval end - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) else if self:GetClientGroupDCSUnit() and not self:GetClientGroupDCSUnit():inAir() then if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + 10 then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration , MessageCategory):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end else if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + self.Messages[MessageId].MessageInterval then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end end diff --git a/Moose Development/Moose/Database.lua b/Moose Development/Moose/Database.lua index 656df9bf0..5cda371f0 100644 --- a/Moose Development/Moose/Database.lua +++ b/Moose Development/Moose/Database.lua @@ -32,15 +32,15 @@ -- @module Database -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Static" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) -Include.File( "Scheduler" ) + + + + + + + + + --- DATABASE class diff --git a/Moose Development/Moose/DeployTask.lua b/Moose Development/Moose/DeployTask.lua index 4bd0cf65c..5a346b3f9 100644 --- a/Moose Development/Moose/DeployTask.lua +++ b/Moose Development/Moose/DeployTask.lua @@ -1,7 +1,7 @@ --- A DEPLOYTASK orchestrates the deployment of CARGO within a specific landing zone. -- @module DEPLOYTASK -Include.File( "Task" ) + --- A DeployTask -- @type DEPLOYTASK diff --git a/Moose Development/Moose/DestroyBaseTask.lua b/Moose Development/Moose/DestroyBaseTask.lua index 3cef73cd5..b057605ba 100644 --- a/Moose Development/Moose/DestroyBaseTask.lua +++ b/Moose Development/Moose/DestroyBaseTask.lua @@ -4,7 +4,7 @@ -- @see DESTROYUNITTYPESTASK -- @see DESTROY_RADARS_TASK -Include.File("Task") + --- The DESTROYBASETASK class -- @type DESTROYBASETASK diff --git a/Moose Development/Moose/DestroyGroupsTask.lua b/Moose Development/Moose/DestroyGroupsTask.lua index 38cd98fb6..d98d9e710 100644 --- a/Moose Development/Moose/DestroyGroupsTask.lua +++ b/Moose Development/Moose/DestroyGroupsTask.lua @@ -1,7 +1,7 @@ --- DESTROYGROUPSTASK -- @module DESTROYGROUPSTASK -Include.File("DestroyBaseTask") + --- The DESTROYGROUPSTASK class -- @type diff --git a/Moose Development/Moose/DestroyRadarsTask.lua b/Moose Development/Moose/DestroyRadarsTask.lua index 347ad4181..3b1ac5167 100644 --- a/Moose Development/Moose/DestroyRadarsTask.lua +++ b/Moose Development/Moose/DestroyRadarsTask.lua @@ -1,7 +1,7 @@ --- Task class to destroy radar installations. -- @module DESTROYRADARSTASK -Include.File("DestroyBaseTask") + --- The DESTROYRADARS class -- @type diff --git a/Moose Development/Moose/DestroyUnitTypesTask.lua b/Moose Development/Moose/DestroyUnitTypesTask.lua index a4001ccd4..c8683fc6c 100644 --- a/Moose Development/Moose/DestroyUnitTypesTask.lua +++ b/Moose Development/Moose/DestroyUnitTypesTask.lua @@ -1,7 +1,7 @@ --- Set TASK to destroy certain unit types. -- @module DESTROYUNITTYPESTASK -Include.File("DestroyBaseTask") + --- The DESTROYUNITTYPESTASK class -- @type diff --git a/Moose Development/Moose/Escort.lua b/Moose Development/Moose/Escort.lua index 6fc0d5a49..355a576fb 100644 --- a/Moose Development/Moose/Escort.lua +++ b/Moose Development/Moose/Escort.lua @@ -102,11 +102,11 @@ -- @module Escort -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) + + + + + --- -- @type ESCORT diff --git a/Moose Development/Moose/Event.lua b/Moose Development/Moose/Event.lua index 75cfca6ff..e58e8a2ec 100644 --- a/Moose Development/Moose/Event.lua +++ b/Moose Development/Moose/Event.lua @@ -2,9 +2,6 @@ -- @module Event -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - --- The EVENT structure -- @type EVENT -- @field #EVENT.Events Events diff --git a/Moose Development/Moose/GoHomeTask.lua b/Moose Development/Moose/GoHomeTask.lua index 4f302f5a1..35461ea34 100644 --- a/Moose Development/Moose/GoHomeTask.lua +++ b/Moose Development/Moose/GoHomeTask.lua @@ -1,8 +1,6 @@ --- A GOHOMETASK orchestrates the travel back to the home base, which is a specific zone defined within the ME. -- @module GOHOMETASK -Include.File("Task") - --- The GOHOMETASK class -- @type GOHOMETASK = { diff --git a/Moose Development/Moose/Group.lua b/Moose Development/Moose/Group.lua index a63d742a5..4778c31c5 100644 --- a/Moose Development/Moose/Group.lua +++ b/Moose Development/Moose/Group.lua @@ -146,11 +146,6 @@ -- @module Group -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Unit" ) - --- The GROUP class -- @type GROUP -- @extends Base#BASE @@ -2672,7 +2667,7 @@ function GROUP:Message( Message, Duration ) local DCSGroup = self:GetDCSGroup() if DCSGroup then - return MESSAGE:New( Message, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")", Duration, self:GetClassNameAndID() ) + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) end return nil diff --git a/Moose Development/Moose/Menu.lua b/Moose Development/Moose/Menu.lua index e5bdfa778..cdad61304 100644 --- a/Moose Development/Moose/Menu.lua +++ b/Moose Development/Moose/Menu.lua @@ -1,9 +1,6 @@ --- Encapsulation of DCS World Menu system in a set of MENU classes. -- @module Menu -Include.File( "Routines" ) -Include.File( "Base" ) - --- The MENU class -- @type MENU -- @extends Base#BASE diff --git a/Moose Development/Moose/Message.lua b/Moose Development/Moose/Message.lua index 423d23e2c..8c69d9e4b 100644 --- a/Moose Development/Moose/Message.lua +++ b/Moose Development/Moose/Message.lua @@ -1,17 +1,29 @@ ---- 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. +--- This module contains the MESSAGE class. +-- +-- 1) @{Message#MESSAGE} class, extends @{Base#BASE} +-- ================================================= +-- Message System to display Messages to Clients, Coalitions or All. -- 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}(). +-- Messages can contain a category which is indicating the category of the message. +-- +-- 1.1) MESSAGE construction methods +-- --------------------------------- +-- Messages are created with MESSAGE:@{New}. Note that when the MESSAGE object is created, no message is sent yet. +-- To send messages, you need to use the To functions. +-- +-- 1.2) Send messages with MESSAGE To methods +-- ------------------------------------------ +-- Messages are sent to: +-- * Clients with MESSAGE:@{ToClient}(). +-- * Coalitions with MESSAGE:@{ToCoalition}(). +-- * All Players with MESSAGE:@{ToAll}(). +-- -- @module Message - -Include.File( "Base" ) +-- @author FlightControl --- The MESSAGE class -- @type MESSAGE +-- @extends Base#BASE MESSAGE = { ClassName = "MESSAGE", MessageCategory = 0, @@ -22,9 +34,8 @@ MESSAGE = { --- 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. -- @param self -- @param #string MessageText is the text of the Message. --- @param #string MessageCategory is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability. -- @param #number MessageDuration is a number in seconds of how long the MESSAGE should be shown on the display panel. --- @param #string MessageID is a string expressing the ID of the Message. +-- @param #string MessageCategory (optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ". -- @return #MESSAGE -- @usage -- -- Create a series of new Messages. @@ -32,15 +43,15 @@ MESSAGE = { -- -- 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" ) -function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) +-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" ) +-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" ) +-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" ) +-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score") +function MESSAGE:New( MessageText, MessageDuration, MessageCategory ) local self = BASE:Inherit( self, BASE:New() ) - self:F( { MessageText, MessageCategory, MessageDuration, MessageID } ) + self:F( { MessageText, MessageDuration, MessageCategory } ) - -- When no messagecategory is given, we don't show it as a title... + -- When no MessageCategory is given, we don't show it as a title... if MessageCategory and MessageCategory ~= "" then self.MessageCategory = MessageCategory .. ": " else @@ -48,7 +59,6 @@ function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) end self.MessageDuration = MessageDuration - self.MessageID = MessageID self.MessageTime = timer.getTime() self.MessageText = MessageText @@ -174,77 +184,77 @@ end ---- The MESSAGEQUEUE class --- @type MESSAGEQUEUE -MESSAGEQUEUE = { - ClientGroups = {}, - CoalitionSides = {} -} - -function MESSAGEQUEUE:New( RefreshInterval ) - local self = BASE:Inherit( self, BASE:New() ) - self:F( { RefreshInterval } ) - - self.RefreshInterval = RefreshInterval - - --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) - self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) - - return self -end - ---- This function is called automatically by the MESSAGEQUEUE scheduler. -function MESSAGEQUEUE:_DisplayMessages() - - -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - if MessageData.MessageSent == false then - --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageSent = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - - -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. - -- Because the Client messages will overwrite the Coalition messages (for that Client). - for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do - for MessageID, MessageData in pairs( ClientGroupData.Messages ) do - if MessageData.MessageGroup == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageGroup = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - - -- Now check if the Client also has messages that belong to the Coalition of the Client... - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - local CoalitionGroup = Group.getByName( ClientGroupName ) - if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then - if MessageData.MessageCoalition == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageCoalition = true - end - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - end - - return true -end - ---- The _MessageQueue object is created when the MESSAGE class module is loaded. ---_MessageQueue = MESSAGEQUEUE:New( 0.5 ) - +----- The MESSAGEQUEUE class +---- @type MESSAGEQUEUE +--MESSAGEQUEUE = { +-- ClientGroups = {}, +-- CoalitionSides = {} +--} +-- +--function MESSAGEQUEUE:New( RefreshInterval ) +-- local self = BASE:Inherit( self, BASE:New() ) +-- self:F( { RefreshInterval } ) +-- +-- self.RefreshInterval = RefreshInterval +-- +-- --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) +-- self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) +-- +-- return self +--end +-- +----- This function is called automatically by the MESSAGEQUEUE scheduler. +--function MESSAGEQUEUE:_DisplayMessages() +-- +-- -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- if MessageData.MessageSent == false then +-- --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageSent = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- +-- -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. +-- -- Because the Client messages will overwrite the Coalition messages (for that Client). +-- for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do +-- for MessageID, MessageData in pairs( ClientGroupData.Messages ) do +-- if MessageData.MessageGroup == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageGroup = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- +-- -- Now check if the Client also has messages that belong to the Coalition of the Client... +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- local CoalitionGroup = Group.getByName( ClientGroupName ) +-- if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then +-- if MessageData.MessageCoalition == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageCoalition = true +-- end +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- end +-- +-- return true +--end +-- +----- The _MessageQueue object is created when the MESSAGE class module is loaded. +----_MessageQueue = MESSAGEQUEUE:New( 0.5 ) +-- diff --git a/Moose Development/Moose/MissileTrainer.lua b/Moose Development/Moose/MissileTrainer.lua index d7773c502..57520d508 100644 --- a/Moose Development/Moose/MissileTrainer.lua +++ b/Moose Development/Moose/MissileTrainer.lua @@ -70,9 +70,6 @@ -- @author FlightControl -Include.File( "Client" ) -Include.File( "Scheduler" ) - --- The MISSILETRAINER class -- @type MISSILETRAINER -- @extends Base#BASE @@ -217,9 +214,9 @@ function MISSILETRAINER:InitMessagesOnOff( MessagesOnOff ) self.MessagesOnOff = MessagesOnOff if self.MessagesOnOff == true then - MESSAGE:New( "Messages ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Messages OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages OFF", 15, "Menu" ):ToAll() end return self @@ -234,9 +231,9 @@ function MISSILETRAINER:InitTrackingToAll( TrackingToAll ) self.TrackingToAll = TrackingToAll if self.TrackingToAll == true then - MESSAGE:New( "Missile tracking to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players OFF", 15, "Menu" ):ToAll() end return self @@ -251,9 +248,9 @@ function MISSILETRAINER:InitTrackingOnOff( TrackingOnOff ) self.TrackingOnOff = TrackingOnOff if self.TrackingOnOff == true then - MESSAGE:New( "Missile tracking ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking OFF", 15, "Menu" ):ToAll() end return self @@ -272,7 +269,7 @@ function MISSILETRAINER:InitTrackingFrequency( TrackingFrequency ) self.TrackingFrequency = 0.5 end if self.TrackingFrequency then - MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", 15, "Menu" ):ToAll() end return self @@ -287,9 +284,9 @@ function MISSILETRAINER:InitAlertsToAll( AlertsToAll ) self.AlertsToAll = AlertsToAll if self.AlertsToAll == true then - MESSAGE:New( "Alerts to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players OFF", 15, "Menu" ):ToAll() end return self @@ -304,9 +301,9 @@ function MISSILETRAINER:InitAlertsHitsOnOff( AlertsHitsOnOff ) self.AlertsHitsOnOff = AlertsHitsOnOff if self.AlertsHitsOnOff == true then - MESSAGE:New( "Alerts Hits ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Hits OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits OFF", 15, "Menu" ):ToAll() end return self @@ -321,9 +318,9 @@ function MISSILETRAINER:InitAlertsLaunchesOnOff( AlertsLaunchesOnOff ) self.AlertsLaunchesOnOff = AlertsLaunchesOnOff if self.AlertsLaunchesOnOff == true then - MESSAGE:New( "Alerts Launches ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Launches OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches OFF", 15, "Menu" ):ToAll() end return self @@ -338,9 +335,9 @@ function MISSILETRAINER:InitRangeOnOff( DetailsRangeOnOff ) self.DetailsRangeOnOff = DetailsRangeOnOff if self.DetailsRangeOnOff == true then - MESSAGE:New( "Range display ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Range display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display OFF", 15, "Menu" ):ToAll() end return self @@ -355,9 +352,9 @@ function MISSILETRAINER:InitBearingOnOff( DetailsBearingOnOff ) self.DetailsBearingOnOff = DetailsBearingOnOff if self.DetailsBearingOnOff == true then - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() else - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() end return self @@ -372,9 +369,9 @@ function MISSILETRAINER:InitMenusOnOff( MenusOnOff ) self.MenusOnOff = MenusOnOff if self.MenusOnOff == true then - MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", 15, "Menu" ):ToAll() else - MESSAGE:New( "Menus are DISABLED", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are DISABLED", 15, "Menu" ):ToAll() end return self @@ -425,7 +422,7 @@ function MISSILETRAINER._MenuMessages( MenuParameters ) if MenuParameters.Distance ~= nil then self.Distance = MenuParameters.Distance - MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", 15, "Menu" ):ToAll() end end @@ -461,7 +458,7 @@ function MISSILETRAINER:_EventShot( Event ) string.format( "%s launched a %s", TrainerSourceUnit:GetTypeName(), TrainerWeaponName - ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ),"Launch Alert", 5, "ID" ) + ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ), 5, "Launch Alert" ) if self.AlertsToAll then Message:ToAll() @@ -576,7 +573,7 @@ function MISSILETRAINER:_TrackMissiles() TrainerWeapon:getTypeName(), TrainerSourceUnit:GetTypeName(), TrainerTargetUnit:GetPlayerName() - ),"Hit Alert", 15, "ID" ) + ), 15, "Hit Alert" ) if self.AlertsToAll == true then Message:ToAll() @@ -597,7 +594,7 @@ function MISSILETRAINER:_TrackMissiles() string.format( "%s launched by %s self destructed!", TrainerWeaponTypeName, TrainerSourceUnit:GetTypeName() - ),"Tracking", 5, "ID" ) + ), 5, "Tracking" ) if self.AlertsToAll == true then Message:ToAll() @@ -671,7 +668,7 @@ function MISSILETRAINER:_TrackMissiles() -- Once the Player Client and the Other Player Client tracking messages are prepared, show them. if ClientData.MessageToClient ~= "" or ClientData.MessageToAll ~= "" then - local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, "Tracking", 1, "ID" ):ToClient( Client ) + local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, 1, "Tracking" ):ToClient( Client ) end end end diff --git a/Moose Development/Moose/Mission.lua b/Moose Development/Moose/Mission.lua index 764f26425..e67271d5c 100644 --- a/Moose Development/Moose/Mission.lua +++ b/Moose Development/Moose/Mission.lua @@ -2,11 +2,6 @@ -- 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}. -- @module Mission -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The MISSION class -- @type MISSION -- @extends Base#BASE @@ -191,7 +186,7 @@ function MISSION:ReportToAll() for TaskID, TaskData in pairs( Tasks ) do TaskText = TaskText .. " - Task " .. TaskID .. ": " .. TaskData.Name .. ": " .. TaskData:GetGoalProgress() .. "\n" end - MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), "Mission Command: Mission Report", 10, self.Name .. '/Status'):ToAll() + MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), 10, "Mission Command: Mission Report" ):ToAll() end @@ -650,7 +645,7 @@ function MISSIONSCHEDULER:TimeShow() self.TimeIntervalCount = self.TimeIntervalCount + 1 if self.TimeIntervalCount >= self.TimeTriggerShow then local TimeMsg = string.format("%00d", ( self.TimeSeconds / 60 ) - ( timer.getTime() / 60 )) .. ' minutes left until mission reload.' - MESSAGE:New( TimeMsg, "Mission time", self.TimeShow, '/TimeMsg' ):ToAll() + MESSAGE:New( TimeMsg, self.TimeShow, "Mission time" ):ToAll() self.TimeIntervalCount = 0 end end diff --git a/Moose Development/Moose/Moose.lua b/Moose Development/Moose/Moose.lua index 123f51481..5221d8f73 100644 --- a/Moose Development/Moose/Moose.lua +++ b/Moose Development/Moose/Moose.lua @@ -2,8 +2,73 @@ Include.File( "Routines" ) Include.File( "Base" ) -Include.File( "Database" ) +Include.File( "Scheduler" ) Include.File( "Event" ) +Include.File( "Menu" ) +Include.File( "Group" ) +Include.File( "Unit" ) +Include.File( "Zone" ) +Include.File( "Client" ) +Include.File( "Static" ) +Include.File( "Database" ) +Include.File( "Set" ) +Include.File( "Point" ) +Include.File( "Moose" ) +Include.File( "Scoring" ) +Include.File( "Cargo" ) +Include.File( "Message" ) +Include.File( "Stage" ) +Include.File( "Task" ) +Include.File( "GoHomeTask" ) +Include.File( "DestroyBaseTask" ) +Include.File( "DestroyGroupsTask" ) +Include.File( "DestroyRadarsTask" ) +Include.File( "DestroyUnitTypesTask" ) +Include.File( "PickupTask" ) +Include.File( "DeployTask" ) +Include.File( "NoTask" ) +Include.File( "RouteTask" ) +Include.File( "Mission" ) +Include.File( "CleanUp" ) +Include.File( "Spawn" ) +Include.File( "Movement" ) +Include.File( "Sead" ) +Include.File( "Escort" ) +Include.File( "MissileTrainer" ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- The order of the declarations is important here. Don't touch it. diff --git a/Moose Development/Moose/Movement.lua b/Moose Development/Moose/Movement.lua index 2b7bb7bee..9ea15f0ae 100644 --- a/Moose Development/Moose/Movement.lua +++ b/Moose Development/Moose/Movement.lua @@ -5,8 +5,6 @@ -- on defined intervals (currently every minute). -- @module MOVEMENT -Include.File( "Routines" ) - --- the MOVEMENT class -- @type MOVEMENT = { diff --git a/Moose Development/Moose/NoTask.lua b/Moose Development/Moose/NoTask.lua index 016ba955e..f3fa13554 100644 --- a/Moose Development/Moose/NoTask.lua +++ b/Moose Development/Moose/NoTask.lua @@ -1,8 +1,6 @@ --- A NOTASK is a dummy activity... But it will show a Mission Briefing... -- @module NOTASK -Include.File("Task") - --- The NOTASK class -- @type NOTASK = { diff --git a/Moose Development/Moose/PickupTask.lua b/Moose Development/Moose/PickupTask.lua index 7cbec30a6..84593c751 100644 --- a/Moose Development/Moose/PickupTask.lua +++ b/Moose Development/Moose/PickupTask.lua @@ -2,9 +2,6 @@ -- @module PICKUPTASK -- @parent TASK -Include.File("Task") -Include.File("Cargo") - --- The PICKUPTASK class -- @type PICKUPTASK = { diff --git a/Moose Development/Moose/Point.lua b/Moose Development/Moose/Point.lua index e0dfa6cdb..f45175397 100644 --- a/Moose Development/Moose/Point.lua +++ b/Moose Development/Moose/Point.lua @@ -25,10 +25,6 @@ -- @module Point -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Point" ) - --- The POINT_VEC3 class -- @type POINT_VEC3 -- @extends Base#BASE diff --git a/Moose Development/Moose/Routines.lua b/Moose Development/Moose/Routines.lua index 58abae93f..5235f218b 100644 --- a/Moose Development/Moose/Routines.lua +++ b/Moose Development/Moose/Routines.lua @@ -2,10 +2,6 @@ -- @module routines -- @author Flightcontrol ---Include.File( "Trace" ) ---Include.File( "Message" ) - - env.setErrorMessageBoxEnabled(false) --- Extract of MIST functions. @@ -2310,19 +2306,19 @@ end function MessageToAll( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "Message", MsgTime, MsgName ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) + MESSAGE:New( MsgText, MsgTime, "Message" ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) end function MessageToRed( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Red Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Red Coalition" ):ToCoalition( coalition.side.RED ) end function MessageToBlue( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Blue Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Blue Coalition" ):ToCoalition( coalition.side.RED ) end function getCarrierHeight( CarrierGroup ) diff --git a/Moose Development/Moose/Scheduler.lua b/Moose Development/Moose/Scheduler.lua index 259933c68..ad45956f6 100644 --- a/Moose Development/Moose/Scheduler.lua +++ b/Moose Development/Moose/Scheduler.lua @@ -20,10 +20,6 @@ -- @module Scheduler -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - - --- The SCHEDULER class -- @type SCHEDULER -- @extends Base#BASE diff --git a/Moose Development/Moose/Scoring.lua b/Moose Development/Moose/Scoring.lua index 5d2a9dc15..f853a4bb4 100644 --- a/Moose Development/Moose/Scoring.lua +++ b/Moose Development/Moose/Scoring.lua @@ -7,13 +7,6 @@ -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Event" ) - - --- The Scoring class -- @type SCORING -- @field Players A collection of the current players that have joined the game. @@ -176,7 +169,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].PenaltyKill .. " times. Penalty: -" .. PlayerData.Kill[TargetCategory][TargetType].Penalty .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/PENALTY" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_PENALTY", 1, -125, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else PlayerData.Score = PlayerData.Score + 10 @@ -185,7 +178,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed an enemy " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].ScoreKill .. " times. Score: " .. PlayerData.Kill[TargetCategory][TargetType].Score .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/SCORE" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_SCORE", 1, 10, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end end @@ -236,9 +229,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName].PenaltyCoalition = self.Players[PlayerName].PenaltyCoalition + 1 MESSAGE:New( "Player '" .. PlayerName .. "' changed coalition from " .. _SCORINGCoalition[self.Players[PlayerName].UnitCoalition] .. " to " .. _SCORINGCoalition[UnitCoalition] .. "(changed " .. self.Players[PlayerName].PenaltyCoalition .. " times the coalition). 50 Penalty points added.", - "", - 2, - "/PENALTYCOALITION" .. PlayerName + 2 ):ToAll() self:ScoreCSV( PlayerName, "COALITION_PENALTY", 1, -50, self.Players[PlayerName].UnitName, _SCORINGCoalition[self.Players[PlayerName].UnitCoalition], _SCORINGCategory[self.Players[PlayerName].UnitCategory], self.Players[PlayerName].UnitType, UnitName, _SCORINGCoalition[UnitCoalition], _SCORINGCategory[UnitCategory], UnitData:getTypeName() ) @@ -252,9 +243,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) if self.Players[PlayerName].Penalty > 100 then if self.Players[PlayerName].PenaltyWarning < 1 then MESSAGE:New( "Player '" .. PlayerName .. "': WARNING! If you continue to commit FRATRICIDE and have a PENALTY score higher than 150, you will be COURT MARTIALED and DISMISSED from this mission! \nYour total penalty is: " .. self.Players[PlayerName].Penalty, - "", - 30, - "/PENALTYCOALITION" .. PlayerName + 30 ):ToAll() self.Players[PlayerName].PenaltyWarning = self.Players[PlayerName].PenaltyWarning + 1 end @@ -264,9 +253,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) ClientGroup = GROUP:NewFromDCSUnit( UnitData ) ClientGroup:Destroy() MESSAGE:New( "Player '" .. PlayerName .. "' committed FRATRICIDE, he will be COURT MARTIALED and is DISMISSED from this mission!", - "", - 10, - "/PENALTYCOALITION" .. PlayerName + 10 ):ToAll() end @@ -294,7 +281,7 @@ function SCORING:_AddMissionTaskScore( PlayerUnit, MissionName, Score ) MESSAGE:New( "Player '" .. PlayerName .. "' has finished another Task in Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCORETASK" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:getName() ) end @@ -311,7 +298,7 @@ function SCORING:_AddMissionScore( MissionName, Score ) PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score MESSAGE:New( "Player '" .. PlayerName .. "' has finished Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCOREMISSION" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "MISSION_" .. MissionName:gsub( ' ', '_' ), 1, Score ) end end @@ -421,9 +408,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].PenaltyHit .. " times. Penalty: -" .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Penalty .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/PENALTY" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_PENALTY", 1, -25, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else @@ -433,9 +418,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].ScoreHit .. " times. Score: " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Score .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/SCORE" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_SCORE", 1, 1, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end @@ -556,7 +539,7 @@ function SCORING:ReportScoreAll() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score:%d (%d Score -%d Penalties)%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end @@ -669,7 +652,7 @@ function SCORING:ReportScorePlayer() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score = %d ( %d Score, -%d Penalties ):%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end diff --git a/Moose Development/Moose/Sead.lua b/Moose Development/Moose/Sead.lua index dd47ff2e5..489c1ecf9 100644 --- a/Moose Development/Moose/Sead.lua +++ b/Moose Development/Moose/Sead.lua @@ -3,13 +3,6 @@ -- @author to be searched on the forum -- @author (co) Flightcontrol (Modified and enriched with functionality) -Include.File( "Routines" ) -Include.File( "Event" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The SEAD class -- @type SEAD -- @extends Base#BASE diff --git a/Moose Development/Moose/Set.lua b/Moose Development/Moose/Set.lua index da27604ce..be3cf1526 100644 --- a/Moose Development/Moose/Set.lua +++ b/Moose Development/Moose/Set.lua @@ -127,14 +127,6 @@ -- @module Set -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) - --- SET_BASE class -- @type SET_BASE -- @extends Base#BASE diff --git a/Moose Development/Moose/Spawn.lua b/Moose Development/Moose/Spawn.lua index 93715afe6..3a2e588b6 100644 --- a/Moose Development/Moose/Spawn.lua +++ b/Moose Development/Moose/Spawn.lua @@ -74,14 +74,6 @@ -- @module Spawn -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) -Include.File( "Event" ) -Include.File( "Scheduler" ) - --- SPAWN Class -- @type SPAWN -- @extends Base#BASE @@ -783,7 +775,7 @@ end -- If no index is given, it will return the first group in the list. -- @param #SPAWN self -- @param #number SpawnIndex The index of the group to return. --- @return Group#GROUP +-- @return Group#GROUP self function SPAWN:GetGroupFromIndex( SpawnIndex ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnIndex } ) diff --git a/Moose Development/Moose/Stage.lua b/Moose Development/Moose/Stage.lua index d28c22c7d..839fcb500 100644 --- a/Moose Development/Moose/Stage.lua +++ b/Moose Development/Moose/Stage.lua @@ -2,11 +2,11 @@ -- @module STAGE -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The STAGE class -- @type diff --git a/Moose Development/Moose/StatHandler.lua b/Moose Development/Moose/StatHandler.lua index 22b6072b3..1e3f2b29f 100644 --- a/Moose Development/Moose/StatHandler.lua +++ b/Moose Development/Moose/StatHandler.lua @@ -1,7 +1,7 @@ --- Provides a logging of statistics in a running DCS Mission. -- @script eStatHandler -Include.File( "Routines" ) + --Handler table diff --git a/Moose Development/Moose/Static.lua b/Moose Development/Moose/Static.lua index ba6467023..76e385b57 100644 --- a/Moose Development/Moose/Static.lua +++ b/Moose Development/Moose/Static.lua @@ -31,9 +31,9 @@ -- @module Static -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The STATIC class diff --git a/Moose Development/Moose/Task.lua b/Moose Development/Moose/Task.lua index 68cd199e1..09e38917e 100644 --- a/Moose Development/Moose/Task.lua +++ b/Moose Development/Moose/Task.lua @@ -1,11 +1,11 @@ --- The TASK Classes define major end-to-end activities within a MISSION. The TASK Class is the Master Class to orchestrate these activities. From this class, many concrete TASK classes are inherited. -- @module TASK -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Stage" ) + + + + + --- The TASK class -- @type TASK diff --git a/Moose Development/Moose/Unit.lua b/Moose Development/Moose/Unit.lua index cdb8a43f8..8d1a1c1fb 100644 --- a/Moose Development/Moose/Unit.lua +++ b/Moose Development/Moose/Unit.lua @@ -68,9 +68,9 @@ -- @module Unit -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The UNIT class -- @type UNIT diff --git a/Moose Development/Moose/Zone.lua b/Moose Development/Moose/Zone.lua index a27c3f1df..7a93f1616 100644 --- a/Moose Development/Moose/Zone.lua +++ b/Moose Development/Moose/Zone.lua @@ -62,10 +62,10 @@ -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Point" ) + + + + diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 0f7292e6f..52bfe1b8a 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160608_1752' ) +env.info( 'Moose Generation Timestamp: 20160609_1242' ) local base = _G env.info("Loading MOOSE " .. base.timer.getAbsTime() ) @@ -28,10 +28,6 @@ env.info("Loaded MOOSE Include Engine") -- @module routines -- @author Flightcontrol ---Include.File( "Trace" ) ---Include.File( "Message" ) - - env.setErrorMessageBoxEnabled(false) --- Extract of MIST functions. @@ -2336,19 +2332,19 @@ end function MessageToAll( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "Message", MsgTime, MsgName ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) + MESSAGE:New( MsgText, MsgTime, "Message" ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) end function MessageToRed( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Red Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Red Coalition" ):ToCoalition( coalition.side.RED ) end function MessageToBlue( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Blue Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Blue Coalition" ):ToCoalition( coalition.side.RED ) end function getCarrierHeight( CarrierGroup ) @@ -2603,7 +2599,7 @@ env.info(( 'Init: Scripts Loaded v1.1' )) -- @module Base -- @author FlightControl -Include.File( "Routines" ) + local _TraceOn = true local _TraceLevel = 1 @@ -3076,10 +3072,6 @@ end -- @module Scheduler -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - - --- The SCHEDULER class -- @type SCHEDULER -- @extends Base#BASE @@ -3200,9 +3192,6 @@ end -- @module Event -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - --- The EVENT structure -- @type EVENT -- @field #EVENT.Events Events @@ -3710,9 +3699,6 @@ end --- Encapsulation of DCS World Menu system in a set of MENU classes. -- @module Menu -Include.File( "Routines" ) -Include.File( "Base" ) - --- The MENU class -- @type MENU -- @extends Base#BASE @@ -4226,11 +4212,6 @@ end -- @module Group -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Unit" ) - --- The GROUP class -- @type GROUP -- @extends Base#BASE @@ -6752,7 +6733,7 @@ function GROUP:Message( Message, Duration ) local DCSGroup = self:GetDCSGroup() if DCSGroup then - return MESSAGE:New( Message, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")", Duration, self:GetClassNameAndID() ) + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) end return nil @@ -6892,9 +6873,9 @@ end -- @module Unit -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The UNIT class -- @type UNIT @@ -7684,10 +7665,10 @@ end -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Point" ) + + + + @@ -8138,10 +8119,10 @@ end -- @module Client -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Cargo" ) -Include.File( "Message" ) + + + + --- The CLIENT class @@ -8563,16 +8544,16 @@ function CLIENT:Message( Message, MessageDuration, MessageId, MessageCategory, M else self.Messages[MessageId].MessageInterval = MessageInterval end - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) else if self:GetClientGroupDCSUnit() and not self:GetClientGroupDCSUnit():inAir() then if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + 10 then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration , MessageCategory):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end else if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + self.Messages[MessageId].MessageInterval then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end end @@ -8612,9 +8593,9 @@ end -- @module Static -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The STATIC class @@ -8694,15 +8675,15 @@ end -- @module Database -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Static" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) -Include.File( "Scheduler" ) + + + + + + + + + --- DATABASE class @@ -9462,14 +9443,6 @@ end -- @module Set -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) - --- SET_BASE class -- @type SET_BASE -- @extends Base#BASE @@ -10465,10 +10438,6 @@ end -- @module Point -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Point" ) - --- The POINT_VEC3 class -- @type POINT_VEC3 -- @extends Base#BASE @@ -10637,8 +10606,73 @@ end Include.File( "Routines" ) Include.File( "Base" ) -Include.File( "Database" ) +Include.File( "Scheduler" ) Include.File( "Event" ) +Include.File( "Menu" ) +Include.File( "Group" ) +Include.File( "Unit" ) +Include.File( "Zone" ) +Include.File( "Client" ) +Include.File( "Static" ) +Include.File( "Database" ) +Include.File( "Set" ) +Include.File( "Point" ) +Include.File( "Moose" ) +Include.File( "Scoring" ) +Include.File( "Cargo" ) +Include.File( "Message" ) +Include.File( "Stage" ) +Include.File( "Task" ) +Include.File( "GoHomeTask" ) +Include.File( "DestroyBaseTask" ) +Include.File( "DestroyGroupsTask" ) +Include.File( "DestroyRadarsTask" ) +Include.File( "DestroyUnitTypesTask" ) +Include.File( "PickupTask" ) +Include.File( "DeployTask" ) +Include.File( "NoTask" ) +Include.File( "RouteTask" ) +Include.File( "Mission" ) +Include.File( "CleanUp" ) +Include.File( "Spawn" ) +Include.File( "Movement" ) +Include.File( "Sead" ) +Include.File( "Escort" ) +Include.File( "MissileTrainer" ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- The order of the declarations is important here. Don't touch it. @@ -10657,13 +10691,6 @@ _DATABASE = DATABASE:New() -- Database#DATABASE -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Event" ) - - --- The Scoring class -- @type SCORING -- @field Players A collection of the current players that have joined the game. @@ -10826,7 +10853,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].PenaltyKill .. " times. Penalty: -" .. PlayerData.Kill[TargetCategory][TargetType].Penalty .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/PENALTY" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_PENALTY", 1, -125, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else PlayerData.Score = PlayerData.Score + 10 @@ -10835,7 +10862,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed an enemy " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].ScoreKill .. " times. Score: " .. PlayerData.Kill[TargetCategory][TargetType].Score .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/SCORE" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_SCORE", 1, 10, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end end @@ -10886,9 +10913,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName].PenaltyCoalition = self.Players[PlayerName].PenaltyCoalition + 1 MESSAGE:New( "Player '" .. PlayerName .. "' changed coalition from " .. _SCORINGCoalition[self.Players[PlayerName].UnitCoalition] .. " to " .. _SCORINGCoalition[UnitCoalition] .. "(changed " .. self.Players[PlayerName].PenaltyCoalition .. " times the coalition). 50 Penalty points added.", - "", - 2, - "/PENALTYCOALITION" .. PlayerName + 2 ):ToAll() self:ScoreCSV( PlayerName, "COALITION_PENALTY", 1, -50, self.Players[PlayerName].UnitName, _SCORINGCoalition[self.Players[PlayerName].UnitCoalition], _SCORINGCategory[self.Players[PlayerName].UnitCategory], self.Players[PlayerName].UnitType, UnitName, _SCORINGCoalition[UnitCoalition], _SCORINGCategory[UnitCategory], UnitData:getTypeName() ) @@ -10902,9 +10927,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) if self.Players[PlayerName].Penalty > 100 then if self.Players[PlayerName].PenaltyWarning < 1 then MESSAGE:New( "Player '" .. PlayerName .. "': WARNING! If you continue to commit FRATRICIDE and have a PENALTY score higher than 150, you will be COURT MARTIALED and DISMISSED from this mission! \nYour total penalty is: " .. self.Players[PlayerName].Penalty, - "", - 30, - "/PENALTYCOALITION" .. PlayerName + 30 ):ToAll() self.Players[PlayerName].PenaltyWarning = self.Players[PlayerName].PenaltyWarning + 1 end @@ -10914,9 +10937,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) ClientGroup = GROUP:NewFromDCSUnit( UnitData ) ClientGroup:Destroy() MESSAGE:New( "Player '" .. PlayerName .. "' committed FRATRICIDE, he will be COURT MARTIALED and is DISMISSED from this mission!", - "", - 10, - "/PENALTYCOALITION" .. PlayerName + 10 ):ToAll() end @@ -10944,7 +10965,7 @@ function SCORING:_AddMissionTaskScore( PlayerUnit, MissionName, Score ) MESSAGE:New( "Player '" .. PlayerName .. "' has finished another Task in Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCORETASK" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:getName() ) end @@ -10961,7 +10982,7 @@ function SCORING:_AddMissionScore( MissionName, Score ) PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score MESSAGE:New( "Player '" .. PlayerName .. "' has finished Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCOREMISSION" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "MISSION_" .. MissionName:gsub( ' ', '_' ), 1, Score ) end end @@ -11071,9 +11092,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].PenaltyHit .. " times. Penalty: -" .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Penalty .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/PENALTY" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_PENALTY", 1, -25, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else @@ -11083,9 +11102,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].ScoreHit .. " times. Score: " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Score .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/SCORE" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_SCORE", 1, 1, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end @@ -11206,7 +11223,7 @@ function SCORING:ReportScoreAll() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score:%d (%d Score -%d Penalties)%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end @@ -11319,7 +11336,7 @@ function SCORING:ReportScorePlayer() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score = %d ( %d Score, -%d Penalties ):%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end @@ -11469,10 +11486,10 @@ end --- CARGO Classes -- @module CARGO -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Scheduler" ) + + + + --- Clients are those Groups defined within the Mission Editor that have the skillset defined as "Client" or "Player". @@ -12546,20 +12563,32 @@ function CARGO_SLINGLOAD:UnLoad( Client, TargetZoneName ) return Cargo end ---- 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. +--- This module contains the MESSAGE class. +-- +-- 1) @{Message#MESSAGE} class, extends @{Base#BASE} +-- ================================================= +-- Message System to display Messages to Clients, Coalitions or All. -- 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}(). +-- Messages can contain a category which is indicating the category of the message. +-- +-- 1.1) MESSAGE construction methods +-- --------------------------------- +-- Messages are created with MESSAGE:@{New}. Note that when the MESSAGE object is created, no message is sent yet. +-- To send messages, you need to use the To functions. +-- +-- 1.2) Send messages with MESSAGE To methods +-- ------------------------------------------ +-- Messages are sent to: +-- * Clients with MESSAGE:@{ToClient}(). +-- * Coalitions with MESSAGE:@{ToCoalition}(). +-- * All Players with MESSAGE:@{ToAll}(). +-- -- @module Message - -Include.File( "Base" ) +-- @author FlightControl --- The MESSAGE class -- @type MESSAGE +-- @extends Base#BASE MESSAGE = { ClassName = "MESSAGE", MessageCategory = 0, @@ -12570,9 +12599,8 @@ MESSAGE = { --- 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. -- @param self -- @param #string MessageText is the text of the Message. --- @param #string MessageCategory is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability. -- @param #number MessageDuration is a number in seconds of how long the MESSAGE should be shown on the display panel. --- @param #string MessageID is a string expressing the ID of the Message. +-- @param #string MessageCategory (optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ". -- @return #MESSAGE -- @usage -- -- Create a series of new Messages. @@ -12580,15 +12608,15 @@ MESSAGE = { -- -- 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" ) -function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) +-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" ) +-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" ) +-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" ) +-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score") +function MESSAGE:New( MessageText, MessageDuration, MessageCategory ) local self = BASE:Inherit( self, BASE:New() ) - self:F( { MessageText, MessageCategory, MessageDuration, MessageID } ) + self:F( { MessageText, MessageDuration, MessageCategory } ) - -- When no messagecategory is given, we don't show it as a title... + -- When no MessageCategory is given, we don't show it as a title... if MessageCategory and MessageCategory ~= "" then self.MessageCategory = MessageCategory .. ": " else @@ -12596,7 +12624,6 @@ function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) end self.MessageDuration = MessageDuration - self.MessageID = MessageID self.MessageTime = timer.getTime() self.MessageText = MessageText @@ -12722,89 +12749,89 @@ end ---- The MESSAGEQUEUE class --- @type MESSAGEQUEUE -MESSAGEQUEUE = { - ClientGroups = {}, - CoalitionSides = {} -} - -function MESSAGEQUEUE:New( RefreshInterval ) - local self = BASE:Inherit( self, BASE:New() ) - self:F( { RefreshInterval } ) - - self.RefreshInterval = RefreshInterval - - --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) - self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) - - return self -end - ---- This function is called automatically by the MESSAGEQUEUE scheduler. -function MESSAGEQUEUE:_DisplayMessages() - - -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - if MessageData.MessageSent == false then - --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageSent = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - - -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. - -- Because the Client messages will overwrite the Coalition messages (for that Client). - for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do - for MessageID, MessageData in pairs( ClientGroupData.Messages ) do - if MessageData.MessageGroup == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageGroup = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - - -- Now check if the Client also has messages that belong to the Coalition of the Client... - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - local CoalitionGroup = Group.getByName( ClientGroupName ) - if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then - if MessageData.MessageCoalition == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageCoalition = true - end - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - end - - return true -end - ---- The _MessageQueue object is created when the MESSAGE class module is loaded. ---_MessageQueue = MESSAGEQUEUE:New( 0.5 ) - +----- The MESSAGEQUEUE class +---- @type MESSAGEQUEUE +--MESSAGEQUEUE = { +-- ClientGroups = {}, +-- CoalitionSides = {} +--} +-- +--function MESSAGEQUEUE:New( RefreshInterval ) +-- local self = BASE:Inherit( self, BASE:New() ) +-- self:F( { RefreshInterval } ) +-- +-- self.RefreshInterval = RefreshInterval +-- +-- --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) +-- self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) +-- +-- return self +--end +-- +----- This function is called automatically by the MESSAGEQUEUE scheduler. +--function MESSAGEQUEUE:_DisplayMessages() +-- +-- -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- if MessageData.MessageSent == false then +-- --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageSent = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- +-- -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. +-- -- Because the Client messages will overwrite the Coalition messages (for that Client). +-- for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do +-- for MessageID, MessageData in pairs( ClientGroupData.Messages ) do +-- if MessageData.MessageGroup == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageGroup = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- +-- -- Now check if the Client also has messages that belong to the Coalition of the Client... +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- local CoalitionGroup = Group.getByName( ClientGroupName ) +-- if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then +-- if MessageData.MessageCoalition == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageCoalition = true +-- end +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- end +-- +-- return true +--end +-- +----- The _MessageQueue object is created when the MESSAGE class module is loaded. +----_MessageQueue = MESSAGEQUEUE:New( 0.5 ) +-- --- Stages within a @{TASK} within a @{MISSION}. All of the STAGE functionality is considered internally administered and not to be used by any Mission designer. -- @module STAGE -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The STAGE class -- @type @@ -13766,11 +13793,11 @@ _TransportStageAction = { --- The TASK Classes define major end-to-end activities within a MISSION. The TASK Class is the Master Class to orchestrate these activities. From this class, many concrete TASK classes are inherited. -- @module TASK -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Stage" ) + + + + + --- The TASK class -- @type TASK @@ -14231,8 +14258,6 @@ end --- A GOHOMETASK orchestrates the travel back to the home base, which is a specific zone defined within the ME. -- @module GOHOMETASK -Include.File("Task") - --- The GOHOMETASK class -- @type GOHOMETASK = { @@ -14269,7 +14294,7 @@ end -- @see DESTROYUNITTYPESTASK -- @see DESTROY_RADARS_TASK -Include.File("Task") + --- The DESTROYBASETASK class -- @type DESTROYBASETASK @@ -14347,7 +14372,7 @@ end --- DESTROYGROUPSTASK -- @module DESTROYGROUPSTASK -Include.File("DestroyBaseTask") + --- The DESTROYGROUPSTASK class -- @type @@ -14404,7 +14429,7 @@ end --- Task class to destroy radar installations. -- @module DESTROYRADARSTASK -Include.File("DestroyBaseTask") + --- The DESTROYRADARS class -- @type @@ -14445,7 +14470,7 @@ end --- Set TASK to destroy certain unit types. -- @module DESTROYUNITTYPESTASK -Include.File("DestroyBaseTask") + --- The DESTROYUNITTYPESTASK class -- @type @@ -14498,9 +14523,6 @@ end -- @module PICKUPTASK -- @parent TASK -Include.File("Task") -Include.File("Cargo") - --- The PICKUPTASK class -- @type PICKUPTASK = { @@ -14653,7 +14675,7 @@ end --- A DEPLOYTASK orchestrates the deployment of CARGO within a specific landing zone. -- @module DEPLOYTASK -Include.File( "Task" ) + --- A DeployTask -- @type DEPLOYTASK @@ -14811,8 +14833,6 @@ end --- A NOTASK is a dummy activity... But it will show a Mission Briefing... -- @module NOTASK -Include.File("Task") - --- The NOTASK class -- @type NOTASK = { @@ -14880,11 +14900,6 @@ end -- 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}. -- @module Mission -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The MISSION class -- @type MISSION -- @extends Base#BASE @@ -15069,7 +15084,7 @@ function MISSION:ReportToAll() for TaskID, TaskData in pairs( Tasks ) do TaskText = TaskText .. " - Task " .. TaskID .. ": " .. TaskData.Name .. ": " .. TaskData:GetGoalProgress() .. "\n" end - MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), "Mission Command: Mission Report", 10, self.Name .. '/Status'):ToAll() + MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), 10, "Mission Command: Mission Report" ):ToAll() end @@ -15528,7 +15543,7 @@ function MISSIONSCHEDULER:TimeShow() self.TimeIntervalCount = self.TimeIntervalCount + 1 if self.TimeIntervalCount >= self.TimeTriggerShow then local TimeMsg = string.format("%00d", ( self.TimeSeconds / 60 ) - ( timer.getTime() / 60 )) .. ' minutes left until mission reload.' - MESSAGE:New( TimeMsg, "Mission time", self.TimeShow, '/TimeMsg' ):ToAll() + MESSAGE:New( TimeMsg, self.TimeShow, "Mission time" ):ToAll() self.TimeIntervalCount = 0 end end @@ -15551,11 +15566,11 @@ end -- @module CleanUp -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The CLEANUP class. -- @type CLEANUP @@ -15607,7 +15622,6 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName ) self:F( { GroupObject, CleanUpGroupName } ) if GroupObject then -- and GroupObject:isExist() then - --MESSAGE:New( "Destroy Group " .. CleanUpGroupName, CleanUpGroupName, 1, CleanUpGroupName ):ToAll() trigger.action.deactivateGroup(GroupObject) self:T( { "GroupObject Destroyed", GroupObject } ) end @@ -15621,7 +15635,6 @@ function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName ) self:F( { CleanUpUnit, CleanUpUnitName } ) if CleanUpUnit then - --MESSAGE:New( "Destroy " .. CleanUpUnitName, CleanUpUnitName, 1, CleanUpUnitName ):ToAll() local CleanUpGroup = Unit.getGroup(CleanUpUnit) -- TODO Client bug in 1.5.3 if CleanUpGroup and CleanUpGroup:isExist() then @@ -15691,7 +15704,6 @@ function CLEANUP:_EventCrash( Event ) self:F( { Event } ) --TODO: This stuff is not working due to a DCS bug. Burning units cannot be destroyed. - --MESSAGE:New( "Crash ", "Crash", 10, "Crash" ):ToAll() -- self:T("before getGroup") -- local _grp = Unit.getGroup(event.initiator)-- Identify the group that fired -- self:T("after getGroup") @@ -15826,7 +15838,6 @@ function CLEANUP:_CleanUpScheduler() --self:T( CleanUpUnitVec2 ) local CleanUpSurfaceType = land.getSurfaceType(CleanUpUnitVec2) --self:T( CleanUpSurfaceType ) - --MESSAGE:New( "Surface " .. CleanUpUnitName .. " = " .. CleanUpSurfaceTypeText[CleanUpSurfaceType], CleanUpUnitName, 10, CleanUpUnitName ):ToAll() if CleanUpUnit and CleanUpUnit:getLife() <= CleanUpUnit:getLife0() * 0.95 then if CleanUpSurfaceType == land.SurfaceType.RUNWAY then @@ -15858,7 +15869,6 @@ function CLEANUP:_CleanUpScheduler() else UnitData.CleanUpTime = timer.getTime() UnitData.CleanUpMoved = true - --MESSAGE:New( "Moved " .. CleanUpUnitName, CleanUpUnitName, 10, CleanUpUnitName ):ToAll() end end @@ -15952,14 +15962,6 @@ end -- @module Spawn -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) -Include.File( "Event" ) -Include.File( "Scheduler" ) - --- SPAWN Class -- @type SPAWN -- @extends Base#BASE @@ -16661,7 +16663,7 @@ end -- If no index is given, it will return the first group in the list. -- @param #SPAWN self -- @param #number SpawnIndex The index of the group to return. --- @return Group#GROUP +-- @return Group#GROUP self function SPAWN:GetGroupFromIndex( SpawnIndex ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnIndex } ) @@ -17147,8 +17149,6 @@ end -- on defined intervals (currently every minute). -- @module MOVEMENT -Include.File( "Routines" ) - --- the MOVEMENT class -- @type MOVEMENT = { @@ -17275,13 +17275,6 @@ end -- @author to be searched on the forum -- @author (co) Flightcontrol (Modified and enriched with functionality) -Include.File( "Routines" ) -Include.File( "Event" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The SEAD class -- @type SEAD -- @extends Base#BASE @@ -17511,11 +17504,11 @@ end -- @module Escort -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) + + + + + --- -- @type ESCORT @@ -18764,9 +18757,6 @@ end -- @author FlightControl -Include.File( "Client" ) -Include.File( "Scheduler" ) - --- The MISSILETRAINER class -- @type MISSILETRAINER -- @extends Base#BASE @@ -18911,9 +18901,9 @@ function MISSILETRAINER:InitMessagesOnOff( MessagesOnOff ) self.MessagesOnOff = MessagesOnOff if self.MessagesOnOff == true then - MESSAGE:New( "Messages ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Messages OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages OFF", 15, "Menu" ):ToAll() end return self @@ -18928,9 +18918,9 @@ function MISSILETRAINER:InitTrackingToAll( TrackingToAll ) self.TrackingToAll = TrackingToAll if self.TrackingToAll == true then - MESSAGE:New( "Missile tracking to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players OFF", 15, "Menu" ):ToAll() end return self @@ -18945,9 +18935,9 @@ function MISSILETRAINER:InitTrackingOnOff( TrackingOnOff ) self.TrackingOnOff = TrackingOnOff if self.TrackingOnOff == true then - MESSAGE:New( "Missile tracking ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking OFF", 15, "Menu" ):ToAll() end return self @@ -18966,7 +18956,7 @@ function MISSILETRAINER:InitTrackingFrequency( TrackingFrequency ) self.TrackingFrequency = 0.5 end if self.TrackingFrequency then - MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", 15, "Menu" ):ToAll() end return self @@ -18981,9 +18971,9 @@ function MISSILETRAINER:InitAlertsToAll( AlertsToAll ) self.AlertsToAll = AlertsToAll if self.AlertsToAll == true then - MESSAGE:New( "Alerts to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players OFF", 15, "Menu" ):ToAll() end return self @@ -18998,9 +18988,9 @@ function MISSILETRAINER:InitAlertsHitsOnOff( AlertsHitsOnOff ) self.AlertsHitsOnOff = AlertsHitsOnOff if self.AlertsHitsOnOff == true then - MESSAGE:New( "Alerts Hits ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Hits OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits OFF", 15, "Menu" ):ToAll() end return self @@ -19015,9 +19005,9 @@ function MISSILETRAINER:InitAlertsLaunchesOnOff( AlertsLaunchesOnOff ) self.AlertsLaunchesOnOff = AlertsLaunchesOnOff if self.AlertsLaunchesOnOff == true then - MESSAGE:New( "Alerts Launches ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Launches OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches OFF", 15, "Menu" ):ToAll() end return self @@ -19032,9 +19022,9 @@ function MISSILETRAINER:InitRangeOnOff( DetailsRangeOnOff ) self.DetailsRangeOnOff = DetailsRangeOnOff if self.DetailsRangeOnOff == true then - MESSAGE:New( "Range display ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Range display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display OFF", 15, "Menu" ):ToAll() end return self @@ -19049,9 +19039,9 @@ function MISSILETRAINER:InitBearingOnOff( DetailsBearingOnOff ) self.DetailsBearingOnOff = DetailsBearingOnOff if self.DetailsBearingOnOff == true then - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() else - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() end return self @@ -19066,9 +19056,9 @@ function MISSILETRAINER:InitMenusOnOff( MenusOnOff ) self.MenusOnOff = MenusOnOff if self.MenusOnOff == true then - MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", 15, "Menu" ):ToAll() else - MESSAGE:New( "Menus are DISABLED", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are DISABLED", 15, "Menu" ):ToAll() end return self @@ -19119,7 +19109,7 @@ function MISSILETRAINER._MenuMessages( MenuParameters ) if MenuParameters.Distance ~= nil then self.Distance = MenuParameters.Distance - MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", 15, "Menu" ):ToAll() end end @@ -19155,7 +19145,7 @@ function MISSILETRAINER:_EventShot( Event ) string.format( "%s launched a %s", TrainerSourceUnit:GetTypeName(), TrainerWeaponName - ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ),"Launch Alert", 5, "ID" ) + ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ), 5, "Launch Alert" ) if self.AlertsToAll then Message:ToAll() @@ -19270,7 +19260,7 @@ function MISSILETRAINER:_TrackMissiles() TrainerWeapon:getTypeName(), TrainerSourceUnit:GetTypeName(), TrainerTargetUnit:GetPlayerName() - ),"Hit Alert", 15, "ID" ) + ), 15, "Hit Alert" ) if self.AlertsToAll == true then Message:ToAll() @@ -19291,7 +19281,7 @@ function MISSILETRAINER:_TrackMissiles() string.format( "%s launched by %s self destructed!", TrainerWeaponTypeName, TrainerSourceUnit:GetTypeName() - ),"Tracking", 5, "ID" ) + ), 5, "Tracking" ) if self.AlertsToAll == true then Message:ToAll() @@ -19365,7 +19355,7 @@ function MISSILETRAINER:_TrackMissiles() -- Once the Player Client and the Other Player Client tracking messages are prepared, show them. if ClientData.MessageToClient ~= "" or ClientData.MessageToAll ~= "" then - local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, "Tracking", 1, "ID" ):ToClient( Client ) + local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, 1, "Tracking" ):ToClient( Client ) end end end diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 0f7292e6f..52bfe1b8a 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160608_1752' ) +env.info( 'Moose Generation Timestamp: 20160609_1242' ) local base = _G env.info("Loading MOOSE " .. base.timer.getAbsTime() ) @@ -28,10 +28,6 @@ env.info("Loaded MOOSE Include Engine") -- @module routines -- @author Flightcontrol ---Include.File( "Trace" ) ---Include.File( "Message" ) - - env.setErrorMessageBoxEnabled(false) --- Extract of MIST functions. @@ -2336,19 +2332,19 @@ end function MessageToAll( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "Message", MsgTime, MsgName ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) + MESSAGE:New( MsgText, MsgTime, "Message" ):ToCoalition( coalition.side.RED ):ToCoalition( coalition.side.BLUE ) end function MessageToRed( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Red Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Red Coalition" ):ToCoalition( coalition.side.RED ) end function MessageToBlue( MsgText, MsgTime, MsgName ) --trace.f() - MESSAGE:New( MsgText, "To Blue Coalition", MsgTime, MsgName ):ToCoalition( coalition.side.RED ) + MESSAGE:New( MsgText, MsgTime, "To Blue Coalition" ):ToCoalition( coalition.side.RED ) end function getCarrierHeight( CarrierGroup ) @@ -2603,7 +2599,7 @@ env.info(( 'Init: Scripts Loaded v1.1' )) -- @module Base -- @author FlightControl -Include.File( "Routines" ) + local _TraceOn = true local _TraceLevel = 1 @@ -3076,10 +3072,6 @@ end -- @module Scheduler -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - - --- The SCHEDULER class -- @type SCHEDULER -- @extends Base#BASE @@ -3200,9 +3192,6 @@ end -- @module Event -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) - --- The EVENT structure -- @type EVENT -- @field #EVENT.Events Events @@ -3710,9 +3699,6 @@ end --- Encapsulation of DCS World Menu system in a set of MENU classes. -- @module Menu -Include.File( "Routines" ) -Include.File( "Base" ) - --- The MENU class -- @type MENU -- @extends Base#BASE @@ -4226,11 +4212,6 @@ end -- @module Group -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Unit" ) - --- The GROUP class -- @type GROUP -- @extends Base#BASE @@ -6752,7 +6733,7 @@ function GROUP:Message( Message, Duration ) local DCSGroup = self:GetDCSGroup() if DCSGroup then - return MESSAGE:New( Message, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")", Duration, self:GetClassNameAndID() ) + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) end return nil @@ -6892,9 +6873,9 @@ end -- @module Unit -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The UNIT class -- @type UNIT @@ -7684,10 +7665,10 @@ end -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Point" ) + + + + @@ -8138,10 +8119,10 @@ end -- @module Client -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Cargo" ) -Include.File( "Message" ) + + + + --- The CLIENT class @@ -8563,16 +8544,16 @@ function CLIENT:Message( Message, MessageDuration, MessageId, MessageCategory, M else self.Messages[MessageId].MessageInterval = MessageInterval end - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) else if self:GetClientGroupDCSUnit() and not self:GetClientGroupDCSUnit():inAir() then if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + 10 then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration , MessageCategory):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end else if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + self.Messages[MessageId].MessageInterval then - MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self ) + MESSAGE:New( Message, MessageDuration, MessageCategory ):ToClient( self ) self.Messages[MessageId].MessageTime = timer.getTime() end end @@ -8612,9 +8593,9 @@ end -- @module Static -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) + + + --- The STATIC class @@ -8694,15 +8675,15 @@ end -- @module Database -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Static" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) -Include.File( "Scheduler" ) + + + + + + + + + --- DATABASE class @@ -9462,14 +9443,6 @@ end -- @module Set -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Unit" ) -Include.File( "Event" ) -Include.File( "Client" ) - --- SET_BASE class -- @type SET_BASE -- @extends Base#BASE @@ -10465,10 +10438,6 @@ end -- @module Point -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Point" ) - --- The POINT_VEC3 class -- @type POINT_VEC3 -- @extends Base#BASE @@ -10637,8 +10606,73 @@ end Include.File( "Routines" ) Include.File( "Base" ) -Include.File( "Database" ) +Include.File( "Scheduler" ) Include.File( "Event" ) +Include.File( "Menu" ) +Include.File( "Group" ) +Include.File( "Unit" ) +Include.File( "Zone" ) +Include.File( "Client" ) +Include.File( "Static" ) +Include.File( "Database" ) +Include.File( "Set" ) +Include.File( "Point" ) +Include.File( "Moose" ) +Include.File( "Scoring" ) +Include.File( "Cargo" ) +Include.File( "Message" ) +Include.File( "Stage" ) +Include.File( "Task" ) +Include.File( "GoHomeTask" ) +Include.File( "DestroyBaseTask" ) +Include.File( "DestroyGroupsTask" ) +Include.File( "DestroyRadarsTask" ) +Include.File( "DestroyUnitTypesTask" ) +Include.File( "PickupTask" ) +Include.File( "DeployTask" ) +Include.File( "NoTask" ) +Include.File( "RouteTask" ) +Include.File( "Mission" ) +Include.File( "CleanUp" ) +Include.File( "Spawn" ) +Include.File( "Movement" ) +Include.File( "Sead" ) +Include.File( "Escort" ) +Include.File( "MissileTrainer" ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- The order of the declarations is important here. Don't touch it. @@ -10657,13 +10691,6 @@ _DATABASE = DATABASE:New() -- Database#DATABASE -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Menu" ) -Include.File( "Group" ) -Include.File( "Event" ) - - --- The Scoring class -- @type SCORING -- @field Players A collection of the current players that have joined the game. @@ -10826,7 +10853,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].PenaltyKill .. " times. Penalty: -" .. PlayerData.Kill[TargetCategory][TargetType].Penalty .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/PENALTY" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_PENALTY", 1, -125, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else PlayerData.Score = PlayerData.Score + 10 @@ -10835,7 +10862,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) MESSAGE:New( "Player '" .. PlayerName .. "' killed an enemy " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerData.Kill[TargetCategory][TargetType].ScoreKill .. " times. Score: " .. PlayerData.Kill[TargetCategory][TargetType].Score .. ". Score Total:" .. PlayerData.Score - PlayerData.Penalty, - "", 5, "/SCORE" .. PlayerName .. "/" .. InitUnitName ):ToAll() + 5 ):ToAll() self:ScoreCSV( PlayerName, "KILL_SCORE", 1, 10, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end end @@ -10886,9 +10913,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName].PenaltyCoalition = self.Players[PlayerName].PenaltyCoalition + 1 MESSAGE:New( "Player '" .. PlayerName .. "' changed coalition from " .. _SCORINGCoalition[self.Players[PlayerName].UnitCoalition] .. " to " .. _SCORINGCoalition[UnitCoalition] .. "(changed " .. self.Players[PlayerName].PenaltyCoalition .. " times the coalition). 50 Penalty points added.", - "", - 2, - "/PENALTYCOALITION" .. PlayerName + 2 ):ToAll() self:ScoreCSV( PlayerName, "COALITION_PENALTY", 1, -50, self.Players[PlayerName].UnitName, _SCORINGCoalition[self.Players[PlayerName].UnitCoalition], _SCORINGCategory[self.Players[PlayerName].UnitCategory], self.Players[PlayerName].UnitType, UnitName, _SCORINGCoalition[UnitCoalition], _SCORINGCategory[UnitCategory], UnitData:getTypeName() ) @@ -10902,9 +10927,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) if self.Players[PlayerName].Penalty > 100 then if self.Players[PlayerName].PenaltyWarning < 1 then MESSAGE:New( "Player '" .. PlayerName .. "': WARNING! If you continue to commit FRATRICIDE and have a PENALTY score higher than 150, you will be COURT MARTIALED and DISMISSED from this mission! \nYour total penalty is: " .. self.Players[PlayerName].Penalty, - "", - 30, - "/PENALTYCOALITION" .. PlayerName + 30 ):ToAll() self.Players[PlayerName].PenaltyWarning = self.Players[PlayerName].PenaltyWarning + 1 end @@ -10914,9 +10937,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) ClientGroup = GROUP:NewFromDCSUnit( UnitData ) ClientGroup:Destroy() MESSAGE:New( "Player '" .. PlayerName .. "' committed FRATRICIDE, he will be COURT MARTIALED and is DISMISSED from this mission!", - "", - 10, - "/PENALTYCOALITION" .. PlayerName + 10 ):ToAll() end @@ -10944,7 +10965,7 @@ function SCORING:_AddMissionTaskScore( PlayerUnit, MissionName, Score ) MESSAGE:New( "Player '" .. PlayerName .. "' has finished another Task in Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCORETASK" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:getName() ) end @@ -10961,7 +10982,7 @@ function SCORING:_AddMissionScore( MissionName, Score ) PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score MESSAGE:New( "Player '" .. PlayerName .. "' has finished Mission '" .. MissionName .. "'. " .. Score .. " Score points added.", - "", 20, "/SCOREMISSION" .. PlayerName ):ToAll() + 20 ):ToAll() self:ScoreCSV( PlayerName, "MISSION_" .. MissionName:gsub( ' ', '_' ), 1, Score ) end end @@ -11071,9 +11092,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a friendly " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].PenaltyHit .. " times. Penalty: -" .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Penalty .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/PENALTY" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_PENALTY", 1, -25, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else @@ -11083,9 +11102,7 @@ function SCORING:_EventOnHit( Event ) MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].ScoreHit .. " times. Score: " .. self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Score .. ". Score Total:" .. self.Players[InitPlayerName].Score - self.Players[InitPlayerName].Penalty, - "", - 2, - "/SCORE" .. InitPlayerName .. "/" .. InitUnitName + 2 ):ToAll() self:ScoreCSV( InitPlayerName, "HIT_SCORE", 1, 1, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) end @@ -11206,7 +11223,7 @@ function SCORING:ReportScoreAll() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score:%d (%d Score -%d Penalties)%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end @@ -11319,7 +11336,7 @@ function SCORING:ReportScorePlayer() PlayerMessage = PlayerMessage .. string.format( "Player '%s' Score = %d ( %d Score, -%d Penalties ):%s", PlayerName, PlayerScore - PlayerPenalty, PlayerScore, PlayerPenalty, ScoreMessage ) end end - MESSAGE:New( PlayerMessage, "Player Scores", 30, "AllPlayerScores"):ToAll() + MESSAGE:New( PlayerMessage, 30, "Player Scores" ):ToAll() end @@ -11469,10 +11486,10 @@ end --- CARGO Classes -- @module CARGO -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Message" ) -Include.File( "Scheduler" ) + + + + --- Clients are those Groups defined within the Mission Editor that have the skillset defined as "Client" or "Player". @@ -12546,20 +12563,32 @@ function CARGO_SLINGLOAD:UnLoad( Client, TargetZoneName ) return Cargo end ---- 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. +--- This module contains the MESSAGE class. +-- +-- 1) @{Message#MESSAGE} class, extends @{Base#BASE} +-- ================================================= +-- Message System to display Messages to Clients, Coalitions or All. -- 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}(). +-- Messages can contain a category which is indicating the category of the message. +-- +-- 1.1) MESSAGE construction methods +-- --------------------------------- +-- Messages are created with MESSAGE:@{New}. Note that when the MESSAGE object is created, no message is sent yet. +-- To send messages, you need to use the To functions. +-- +-- 1.2) Send messages with MESSAGE To methods +-- ------------------------------------------ +-- Messages are sent to: +-- * Clients with MESSAGE:@{ToClient}(). +-- * Coalitions with MESSAGE:@{ToCoalition}(). +-- * All Players with MESSAGE:@{ToAll}(). +-- -- @module Message - -Include.File( "Base" ) +-- @author FlightControl --- The MESSAGE class -- @type MESSAGE +-- @extends Base#BASE MESSAGE = { ClassName = "MESSAGE", MessageCategory = 0, @@ -12570,9 +12599,8 @@ MESSAGE = { --- 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. -- @param self -- @param #string MessageText is the text of the Message. --- @param #string MessageCategory is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability. -- @param #number MessageDuration is a number in seconds of how long the MESSAGE should be shown on the display panel. --- @param #string MessageID is a string expressing the ID of the Message. +-- @param #string MessageCategory (optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ". -- @return #MESSAGE -- @usage -- -- Create a series of new Messages. @@ -12580,15 +12608,15 @@ MESSAGE = { -- -- 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" ) -function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) +-- MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" ) +-- MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" ) +-- MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" ) +-- MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score") +function MESSAGE:New( MessageText, MessageDuration, MessageCategory ) local self = BASE:Inherit( self, BASE:New() ) - self:F( { MessageText, MessageCategory, MessageDuration, MessageID } ) + self:F( { MessageText, MessageDuration, MessageCategory } ) - -- When no messagecategory is given, we don't show it as a title... + -- When no MessageCategory is given, we don't show it as a title... if MessageCategory and MessageCategory ~= "" then self.MessageCategory = MessageCategory .. ": " else @@ -12596,7 +12624,6 @@ function MESSAGE:New( MessageText, MessageCategory, MessageDuration, MessageID ) end self.MessageDuration = MessageDuration - self.MessageID = MessageID self.MessageTime = timer.getTime() self.MessageText = MessageText @@ -12722,89 +12749,89 @@ end ---- The MESSAGEQUEUE class --- @type MESSAGEQUEUE -MESSAGEQUEUE = { - ClientGroups = {}, - CoalitionSides = {} -} - -function MESSAGEQUEUE:New( RefreshInterval ) - local self = BASE:Inherit( self, BASE:New() ) - self:F( { RefreshInterval } ) - - self.RefreshInterval = RefreshInterval - - --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) - self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) - - return self -end - ---- This function is called automatically by the MESSAGEQUEUE scheduler. -function MESSAGEQUEUE:_DisplayMessages() - - -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - if MessageData.MessageSent == false then - --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageSent = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - - -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. - -- Because the Client messages will overwrite the Coalition messages (for that Client). - for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do - for MessageID, MessageData in pairs( ClientGroupData.Messages ) do - if MessageData.MessageGroup == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageGroup = true - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - - -- Now check if the Client also has messages that belong to the Coalition of the Client... - for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do - for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do - local CoalitionGroup = Group.getByName( ClientGroupName ) - if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then - if MessageData.MessageCoalition == false then - trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) - MessageData.MessageCoalition = true - end - end - local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() - if MessageTimeLeft <= 0 then - MessageData = nil - end - end - end - end - - return true -end - ---- The _MessageQueue object is created when the MESSAGE class module is loaded. ---_MessageQueue = MESSAGEQUEUE:New( 0.5 ) - +----- The MESSAGEQUEUE class +---- @type MESSAGEQUEUE +--MESSAGEQUEUE = { +-- ClientGroups = {}, +-- CoalitionSides = {} +--} +-- +--function MESSAGEQUEUE:New( RefreshInterval ) +-- local self = BASE:Inherit( self, BASE:New() ) +-- self:F( { RefreshInterval } ) +-- +-- self.RefreshInterval = RefreshInterval +-- +-- --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval ) +-- self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval ) +-- +-- return self +--end +-- +----- This function is called automatically by the MESSAGEQUEUE scheduler. +--function MESSAGEQUEUE:_DisplayMessages() +-- +-- -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...). +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- if MessageData.MessageSent == false then +-- --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageSent = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- +-- -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition. +-- -- Because the Client messages will overwrite the Coalition messages (for that Client). +-- for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do +-- for MessageID, MessageData in pairs( ClientGroupData.Messages ) do +-- if MessageData.MessageGroup == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageGroup = true +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- +-- -- Now check if the Client also has messages that belong to the Coalition of the Client... +-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do +-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do +-- local CoalitionGroup = Group.getByName( ClientGroupName ) +-- if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then +-- if MessageData.MessageCoalition == false then +-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration ) +-- MessageData.MessageCoalition = true +-- end +-- end +-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime() +-- if MessageTimeLeft <= 0 then +-- MessageData = nil +-- end +-- end +-- end +-- end +-- +-- return true +--end +-- +----- The _MessageQueue object is created when the MESSAGE class module is loaded. +----_MessageQueue = MESSAGEQUEUE:New( 0.5 ) +-- --- Stages within a @{TASK} within a @{MISSION}. All of the STAGE functionality is considered internally administered and not to be used by any Mission designer. -- @module STAGE -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The STAGE class -- @type @@ -13766,11 +13793,11 @@ _TransportStageAction = { --- The TASK Classes define major end-to-end activities within a MISSION. The TASK Class is the Master Class to orchestrate these activities. From this class, many concrete TASK classes are inherited. -- @module TASK -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Stage" ) + + + + + --- The TASK class -- @type TASK @@ -14231,8 +14258,6 @@ end --- A GOHOMETASK orchestrates the travel back to the home base, which is a specific zone defined within the ME. -- @module GOHOMETASK -Include.File("Task") - --- The GOHOMETASK class -- @type GOHOMETASK = { @@ -14269,7 +14294,7 @@ end -- @see DESTROYUNITTYPESTASK -- @see DESTROY_RADARS_TASK -Include.File("Task") + --- The DESTROYBASETASK class -- @type DESTROYBASETASK @@ -14347,7 +14372,7 @@ end --- DESTROYGROUPSTASK -- @module DESTROYGROUPSTASK -Include.File("DestroyBaseTask") + --- The DESTROYGROUPSTASK class -- @type @@ -14404,7 +14429,7 @@ end --- Task class to destroy radar installations. -- @module DESTROYRADARSTASK -Include.File("DestroyBaseTask") + --- The DESTROYRADARS class -- @type @@ -14445,7 +14470,7 @@ end --- Set TASK to destroy certain unit types. -- @module DESTROYUNITTYPESTASK -Include.File("DestroyBaseTask") + --- The DESTROYUNITTYPESTASK class -- @type @@ -14498,9 +14523,6 @@ end -- @module PICKUPTASK -- @parent TASK -Include.File("Task") -Include.File("Cargo") - --- The PICKUPTASK class -- @type PICKUPTASK = { @@ -14653,7 +14675,7 @@ end --- A DEPLOYTASK orchestrates the deployment of CARGO within a specific landing zone. -- @module DEPLOYTASK -Include.File( "Task" ) + --- A DeployTask -- @type DEPLOYTASK @@ -14811,8 +14833,6 @@ end --- A NOTASK is a dummy activity... But it will show a Mission Briefing... -- @module NOTASK -Include.File("Task") - --- The NOTASK class -- @type NOTASK = { @@ -14880,11 +14900,6 @@ end -- 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}. -- @module Mission -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The MISSION class -- @type MISSION -- @extends Base#BASE @@ -15069,7 +15084,7 @@ function MISSION:ReportToAll() for TaskID, TaskData in pairs( Tasks ) do TaskText = TaskText .. " - Task " .. TaskID .. ": " .. TaskData.Name .. ": " .. TaskData:GetGoalProgress() .. "\n" end - MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), "Mission Command: Mission Report", 10, self.Name .. '/Status'):ToAll() + MESSAGE:New( self.MissionCoalition .. ' "' .. self.Name .. '": ' .. self.MissionStatus .. ' ( ' .. self.MissionPriority .. ' mission )' .. AlivePlayers .. "\n" .. TaskText:gsub("\n$",""), 10, "Mission Command: Mission Report" ):ToAll() end @@ -15528,7 +15543,7 @@ function MISSIONSCHEDULER:TimeShow() self.TimeIntervalCount = self.TimeIntervalCount + 1 if self.TimeIntervalCount >= self.TimeTriggerShow then local TimeMsg = string.format("%00d", ( self.TimeSeconds / 60 ) - ( timer.getTime() / 60 )) .. ' minutes left until mission reload.' - MESSAGE:New( TimeMsg, "Mission time", self.TimeShow, '/TimeMsg' ):ToAll() + MESSAGE:New( TimeMsg, self.TimeShow, "Mission time" ):ToAll() self.TimeIntervalCount = 0 end end @@ -15551,11 +15566,11 @@ end -- @module CleanUp -- @author Flightcontrol -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) + + + + + --- The CLEANUP class. -- @type CLEANUP @@ -15607,7 +15622,6 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName ) self:F( { GroupObject, CleanUpGroupName } ) if GroupObject then -- and GroupObject:isExist() then - --MESSAGE:New( "Destroy Group " .. CleanUpGroupName, CleanUpGroupName, 1, CleanUpGroupName ):ToAll() trigger.action.deactivateGroup(GroupObject) self:T( { "GroupObject Destroyed", GroupObject } ) end @@ -15621,7 +15635,6 @@ function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName ) self:F( { CleanUpUnit, CleanUpUnitName } ) if CleanUpUnit then - --MESSAGE:New( "Destroy " .. CleanUpUnitName, CleanUpUnitName, 1, CleanUpUnitName ):ToAll() local CleanUpGroup = Unit.getGroup(CleanUpUnit) -- TODO Client bug in 1.5.3 if CleanUpGroup and CleanUpGroup:isExist() then @@ -15691,7 +15704,6 @@ function CLEANUP:_EventCrash( Event ) self:F( { Event } ) --TODO: This stuff is not working due to a DCS bug. Burning units cannot be destroyed. - --MESSAGE:New( "Crash ", "Crash", 10, "Crash" ):ToAll() -- self:T("before getGroup") -- local _grp = Unit.getGroup(event.initiator)-- Identify the group that fired -- self:T("after getGroup") @@ -15826,7 +15838,6 @@ function CLEANUP:_CleanUpScheduler() --self:T( CleanUpUnitVec2 ) local CleanUpSurfaceType = land.getSurfaceType(CleanUpUnitVec2) --self:T( CleanUpSurfaceType ) - --MESSAGE:New( "Surface " .. CleanUpUnitName .. " = " .. CleanUpSurfaceTypeText[CleanUpSurfaceType], CleanUpUnitName, 10, CleanUpUnitName ):ToAll() if CleanUpUnit and CleanUpUnit:getLife() <= CleanUpUnit:getLife0() * 0.95 then if CleanUpSurfaceType == land.SurfaceType.RUNWAY then @@ -15858,7 +15869,6 @@ function CLEANUP:_CleanUpScheduler() else UnitData.CleanUpTime = timer.getTime() UnitData.CleanUpMoved = true - --MESSAGE:New( "Moved " .. CleanUpUnitName, CleanUpUnitName, 10, CleanUpUnitName ):ToAll() end end @@ -15952,14 +15962,6 @@ end -- @module Spawn -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) -Include.File( "Event" ) -Include.File( "Scheduler" ) - --- SPAWN Class -- @type SPAWN -- @extends Base#BASE @@ -16661,7 +16663,7 @@ end -- If no index is given, it will return the first group in the list. -- @param #SPAWN self -- @param #number SpawnIndex The index of the group to return. --- @return Group#GROUP +-- @return Group#GROUP self function SPAWN:GetGroupFromIndex( SpawnIndex ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnIndex } ) @@ -17147,8 +17149,6 @@ end -- on defined intervals (currently every minute). -- @module MOVEMENT -Include.File( "Routines" ) - --- the MOVEMENT class -- @type MOVEMENT = { @@ -17275,13 +17275,6 @@ end -- @author to be searched on the forum -- @author (co) Flightcontrol (Modified and enriched with functionality) -Include.File( "Routines" ) -Include.File( "Event" ) -Include.File( "Base" ) -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Task" ) - --- The SEAD class -- @type SEAD -- @extends Base#BASE @@ -17511,11 +17504,11 @@ end -- @module Escort -- @author FlightControl -Include.File( "Routines" ) -Include.File( "Base" ) -Include.File( "Database" ) -Include.File( "Group" ) -Include.File( "Zone" ) + + + + + --- -- @type ESCORT @@ -18764,9 +18757,6 @@ end -- @author FlightControl -Include.File( "Client" ) -Include.File( "Scheduler" ) - --- The MISSILETRAINER class -- @type MISSILETRAINER -- @extends Base#BASE @@ -18911,9 +18901,9 @@ function MISSILETRAINER:InitMessagesOnOff( MessagesOnOff ) self.MessagesOnOff = MessagesOnOff if self.MessagesOnOff == true then - MESSAGE:New( "Messages ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Messages OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Messages OFF", 15, "Menu" ):ToAll() end return self @@ -18928,9 +18918,9 @@ function MISSILETRAINER:InitTrackingToAll( TrackingToAll ) self.TrackingToAll = TrackingToAll if self.TrackingToAll == true then - MESSAGE:New( "Missile tracking to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking to all players OFF", 15, "Menu" ):ToAll() end return self @@ -18945,9 +18935,9 @@ function MISSILETRAINER:InitTrackingOnOff( TrackingOnOff ) self.TrackingOnOff = TrackingOnOff if self.TrackingOnOff == true then - MESSAGE:New( "Missile tracking ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Missile tracking OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking OFF", 15, "Menu" ):ToAll() end return self @@ -18966,7 +18956,7 @@ function MISSILETRAINER:InitTrackingFrequency( TrackingFrequency ) self.TrackingFrequency = 0.5 end if self.TrackingFrequency then - MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Missile tracking frequency is " .. self.TrackingFrequency .. " seconds.", 15, "Menu" ):ToAll() end return self @@ -18981,9 +18971,9 @@ function MISSILETRAINER:InitAlertsToAll( AlertsToAll ) self.AlertsToAll = AlertsToAll if self.AlertsToAll == true then - MESSAGE:New( "Alerts to all players ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts to all players OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts to all players OFF", 15, "Menu" ):ToAll() end return self @@ -18998,9 +18988,9 @@ function MISSILETRAINER:InitAlertsHitsOnOff( AlertsHitsOnOff ) self.AlertsHitsOnOff = AlertsHitsOnOff if self.AlertsHitsOnOff == true then - MESSAGE:New( "Alerts Hits ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Hits OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Hits OFF", 15, "Menu" ):ToAll() end return self @@ -19015,9 +19005,9 @@ function MISSILETRAINER:InitAlertsLaunchesOnOff( AlertsLaunchesOnOff ) self.AlertsLaunchesOnOff = AlertsLaunchesOnOff if self.AlertsLaunchesOnOff == true then - MESSAGE:New( "Alerts Launches ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Alerts Launches OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Alerts Launches OFF", 15, "Menu" ):ToAll() end return self @@ -19032,9 +19022,9 @@ function MISSILETRAINER:InitRangeOnOff( DetailsRangeOnOff ) self.DetailsRangeOnOff = DetailsRangeOnOff if self.DetailsRangeOnOff == true then - MESSAGE:New( "Range display ON", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display ON", 15, "Menu" ):ToAll() else - MESSAGE:New( "Range display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Range display OFF", 15, "Menu" ):ToAll() end return self @@ -19049,9 +19039,9 @@ function MISSILETRAINER:InitBearingOnOff( DetailsBearingOnOff ) self.DetailsBearingOnOff = DetailsBearingOnOff if self.DetailsBearingOnOff == true then - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() else - MESSAGE:New( "Bearing display OFF", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Bearing display OFF", 15, "Menu" ):ToAll() end return self @@ -19066,9 +19056,9 @@ function MISSILETRAINER:InitMenusOnOff( MenusOnOff ) self.MenusOnOff = MenusOnOff if self.MenusOnOff == true then - MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are ENABLED (only when a player rejoins a slot)", 15, "Menu" ):ToAll() else - MESSAGE:New( "Menus are DISABLED", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Menus are DISABLED", 15, "Menu" ):ToAll() end return self @@ -19119,7 +19109,7 @@ function MISSILETRAINER._MenuMessages( MenuParameters ) if MenuParameters.Distance ~= nil then self.Distance = MenuParameters.Distance - MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", "Menu", 15, "ID" ):ToAll() + MESSAGE:New( "Hit detection distance set to " .. self.Distance .. " meters", 15, "Menu" ):ToAll() end end @@ -19155,7 +19145,7 @@ function MISSILETRAINER:_EventShot( Event ) string.format( "%s launched a %s", TrainerSourceUnit:GetTypeName(), TrainerWeaponName - ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ),"Launch Alert", 5, "ID" ) + ) .. self:_AddRange( Client, TrainerWeapon ) .. self:_AddBearing( Client, TrainerWeapon ), 5, "Launch Alert" ) if self.AlertsToAll then Message:ToAll() @@ -19270,7 +19260,7 @@ function MISSILETRAINER:_TrackMissiles() TrainerWeapon:getTypeName(), TrainerSourceUnit:GetTypeName(), TrainerTargetUnit:GetPlayerName() - ),"Hit Alert", 15, "ID" ) + ), 15, "Hit Alert" ) if self.AlertsToAll == true then Message:ToAll() @@ -19291,7 +19281,7 @@ function MISSILETRAINER:_TrackMissiles() string.format( "%s launched by %s self destructed!", TrainerWeaponTypeName, TrainerSourceUnit:GetTypeName() - ),"Tracking", 5, "ID" ) + ), 5, "Tracking" ) if self.AlertsToAll == true then Message:ToAll() @@ -19365,7 +19355,7 @@ function MISSILETRAINER:_TrackMissiles() -- Once the Player Client and the Other Player Client tracking messages are prepared, show them. if ClientData.MessageToClient ~= "" or ClientData.MessageToAll ~= "" then - local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, "Tracking", 1, "ID" ):ToClient( Client ) + local Message = MESSAGE:New( ClientData.MessageToClient .. ClientData.MessageToAll, 1, "Tracking" ):ToClient( Client ) end end end diff --git a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.lua b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.lua index 1066f424a..fe8b75910 100644 --- a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.lua +++ b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.lua @@ -1,6 +1,6 @@ -Include.File( 'Cleanup' ) -Include.File( 'Spawn' ) -Include.File( 'Event') + + + Clean = CLEANUP:New( 'CLEAN_BATUMI', 180 ) diff --git a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz index 7dbf52cac..2ddd4a78b 100644 Binary files a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz and b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz differ diff --git a/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.lua b/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.lua deleted file mode 100644 index d299d3501..000000000 --- a/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.lua +++ /dev/null @@ -1,108 +0,0 @@ - -Include.File( 'UnitSet' ) -Include.File( 'GroupSet' ) -Include.File( 'Spawn' ) - -DBBluePlanes = UNITSET:New() - :FilterCoalitions( "blue" ) - :FilterCategories( "plane" ) - :FilterStart() - -DBRedVehicles = UNITSET:New() - :FilterCoalitions( "red" ) - :FilterCategories( "ground" ) - :FilterStart() - -DBShips = UNITSET:New() - :FilterCategories( "ship" ) - :FilterStart() - -DBBelgium = UNITSET:New() - :FilterCategories( "helicopter" ) - :FilterCountries( "BELGIUM" ) - :FilterStart() - -DBNorthKorea = UNITSET:New() - :FilterCountries( "NORTH_KOREA" ) - :FilterStart() - -DBKA50Vinson = UNITSET:New() - :FilterTypes( { "Ka-50", "VINSON" } ) - :FilterStart() - -DBBluePlanesGroup = GROUPSET:New() - :FilterCoalitions( "blue" ) - :FilterCategories( "plane" ) - :FilterStart() - -DBNorthKoreaGroup = GROUPSET:New() - :FilterCountries( "NORTH_KOREA" ) - :FilterStart() - -DBBluePlanes:Flush() -DBRedVehicles:Flush() -DBShips:Flush() -DBBelgium:Flush() -DBNorthKorea:Flush() -DBKA50Vinson:Flush() -DBBluePlanesGroup:Flush() -DBNorthKoreaGroup:Flush() - - -SpawnUS_Plane = SPAWN:New( 'Database Spawn Test USA Plane') -GroupUS_Plane = SpawnUS_Plane:Spawn() - -SpawnUS_Vehicle = SPAWN:New( 'Database Spawn Test USA Vehicle') -GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() - -SpawnUS_Ship = SPAWN:New( 'Database Spawn Test USA Ship') -GroupUS_Ship = SpawnUS_Ship:Spawn() - -SpawnRU_Vehicle = SPAWN:New( 'Database Spawn Test RUSSIA Vehicle') -GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() - -SpawnRU_Ship = SPAWN:New( 'Database Spawn Test RUSSIA Ship') -GroupRU_Ship = SpawnRU_Ship:Spawn() - -SpawnUS_AttackVehicle = SPAWN:New( 'Database Spawn Test USA Attack Vehicle' ) -SpawnRU_AttackVehicle = SPAWN:New( 'Database Spawn Test RUSSIA Attack Vehicle' ) - -for i = 1, 2 do - GroupRU_AttackVehicle = SpawnRU_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone RU"), true) - GroupUS_AttackVehicle = SpawnUS_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone US"), true) -end - - ---DBBlue:TraceDatabase() -SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) -SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) -SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) -SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) -SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) -SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) - -SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) -SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) - -DBRedVehicles - :ForEachUnit( function( MooseUnit ) - DBRedVehicles:T( MooseUnit:GetName() ) - end ) - -local function FlushPlayers() - - _DATABASE:E( "FlushPlayers" ) - _DATABASE - :ForEachPlayerAlive( function( Player ) - _DATABASE:E( Player ) - MESSAGE:New( Player, "Test", 5, "Player Test" ):ToAll() - return true - end ) - return true -end - -_DATABASE:E( "Schedule" ) -local PlayerShow = SCHEDULER:New( nil, FlushPlayers, {}, 1, 10 ) - - - diff --git a/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.miz b/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.miz deleted file mode 100644 index 0ec5118d7..000000000 Binary files a/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.miz and /dev/null differ diff --git a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz index adef34e4c..e1d4bb895 100644 Binary files a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz and b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz differ diff --git a/Moose Test Missions/Moose_Test_DESTROY/Moose_Test_DESTROY.lua b/Moose Test Missions/Moose_Test_DESTROY/Moose_Test_DESTROY.lua index 2caa20805..a6efabd7f 100644 --- a/Moose Test Missions/Moose_Test_DESTROY/Moose_Test_DESTROY.lua +++ b/Moose Test Missions/Moose_Test_DESTROY/Moose_Test_DESTROY.lua @@ -1,13 +1,3 @@ --- MOOSE include files. -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "DestroyGroupsTask" ) -Include.File( "DestroyRadarsTask" ) -Include.File( "DestroyUnitTypesTask" ) -Include.File( "Group" ) -Include.File( "Unit" ) -Include.File( "Zone" ) -Include.File( "Event" ) do local Mission = MISSION:New( 'Destroy Gound', 'Ground', 'Briefing', 'CCCP' ) diff --git a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.lua b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.lua index e6803dad4..732b5b5ac 100644 --- a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.lua +++ b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.lua @@ -1,7 +1,7 @@ -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "Spawn" ) -Include.File( "Escort" ) + + + + diff --git a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz index 17306c194..355f1f252 100644 Binary files a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz and b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz differ diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua index c8d4596ff..b28f6644d 100644 --- a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua +++ b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua @@ -2,7 +2,7 @@ -- Only use Include.File when developing new MOOSE classes. -- When using Moose.lua in the DO SCIPTS FILE initialization box, -- these Include.File statements are not needed, because all classes within Moose will be loaded. -Include.File("MissileTrainer") + -- This is an example of a global local Trainer = MISSILETRAINER diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz index 018d968c3..69c931104 100644 Binary files a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz and b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz differ diff --git a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz index b154eabb3..07d8b34a1 100644 Binary files a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz and b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz differ diff --git a/Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua b/Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua index 736f8600e..ea28a16be 100644 --- a/Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua +++ b/Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua @@ -1,4 +1,4 @@ -Include.File( "Sead" ) + -- CCCP SEAD Defenses diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua index d5ed824df..be6eb4cad 100644 --- a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua +++ b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua @@ -1,6 +1,6 @@ -Include.File( 'Set' ) -Include.File( 'Spawn' ) + + SetVehicles = SET_GROUP:New() diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz index d479a16e0..0dfc8dcb6 100644 Binary files a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz and b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua index c2f784faa..cbab519b1 100644 --- a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua +++ b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua @@ -1,4 +1,4 @@ -Include.File( "Spawn" ) + -- Tests Anapa: Spawn Basics diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz index f29ec7778..d7288cbcd 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz and b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.lua b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.lua index 5dbb5b963..76f282b8c 100644 --- a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.lua +++ b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.lua @@ -10,7 +10,7 @@ -- @author FlightControl -Include.File("Spawn") + do diff --git a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz index 42de42467..1855e720b 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz and b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz differ diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua index 53728aaa4..28bf2a9d8 100644 --- a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua +++ b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua @@ -1,15 +1,15 @@ -Include.File( "Mission" ) -Include.File( "Client" ) -Include.File( "DeployTask" ) -Include.File( "PickupTask" ) -Include.File( "DestroyGroupsTask" ) -Include.File( "DestroyRadarsTask" ) -Include.File( "DestroyUnitTypesTask" ) -Include.File( "GoHomeTask" ) -Include.File( "Spawn" ) -Include.File( "Movement" ) -Include.File( "Sead" ) -Include.File( "CleanUp" ) + + + + + + + + + + + + do local Mission = MISSION:New( 'Pickup', 'Operational', 'Pickup Troops', 'NATO' ) diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz index 0ac932082..9930ee92b 100644 Binary files a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz and b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz differ diff --git a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.lua b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.lua index dc09e4e7d..d05eb4b02 100644 --- a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.lua +++ b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.lua @@ -1,7 +1,7 @@ -Include.File( "Group" ) -Include.File( "Unit" ) -Include.File( "Client" ) + + + BASE:TraceClass( "UNIT" ) BASE:TraceClass( "GROUP" ) diff --git a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz index 8957c9541..b4fd92676 100644 Binary files a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz and b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua index d9bbe059d..cfdfbbf70 100644 --- a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua +++ b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua @@ -1,7 +1,7 @@ -Include.File( "Zone" ) -Include.File( "Group" ) -Include.File( "Scheduler" ) + + + local GroupInside = GROUP:FindByName( "Test Inside Polygon" ) local GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz index b080d8a4c..82222cecf 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz and b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua index bfa24fa60..55404345d 100644 --- a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua +++ b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua @@ -1,7 +1,7 @@ -Include.File( "Zone" ) -Include.File( "Group" ) -Include.File( "Scheduler" ) + + + local GroupInside = GROUP:FindByName( "Test Inside Polygon" ) local GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz index 3d83bba99..83e754f6a 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz and b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua index 1d01e5451..34d4c7699 100644 --- a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua +++ b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua @@ -1,7 +1,7 @@ -Include.File( "Zone" ) -Include.File( "Group" ) -Include.File( "Scheduler" ) + + + local GroupInside = GROUP:FindByName( "Test Inside Polygon" ) local GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz index 0ebf5cfa9..7fdebb91a 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz and b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua index 3573a123c..a034ab8d5 100644 --- a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua +++ b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua @@ -1,7 +1,7 @@ -Include.File( "Zone" ) -Include.File( "Group" ) -Include.File( "Scheduler" ) + + + local GroupInside = GROUP:FindByName( "Test Inside Polygon" ) local GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz index ec99c5cac..69196e86d 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz and b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz differ diff --git a/Moose Training/Documentation/Message.html b/Moose Training/Documentation/Message.html index b272f052c..a3d1fd6be 100644 --- a/Moose Training/Documentation/Message.html +++ b/Moose Training/Documentation/Message.html @@ -71,16 +71,25 @@

Module Message

-

Message System to display Messages for Clients and Coalitions or All.

+

This module contains the MESSAGE class.

-

Messages are grouped on the display panel per Category to improve readability for the players. + +

1) Message#MESSAGE class, extends Base#BASE

+

Message System to display Messages to Clients, Coalitions or All. 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().

+Messages can contain a category which is indicating the category of the message.

+ +

1.1) MESSAGE construction methods

+

Messages are created with MESSAGE:New. Note that when the MESSAGE object is created, no message is sent yet. +To send messages, you need to use the To functions.

+ +

1.2) Send messages with MESSAGE To methods

+

Messages are sent to: + * Clients with MESSAGE:ToClient(). + * Coalitions with MESSAGE:ToCoalition(). + * All Players with MESSAGE:ToAll(). +

Global(s)

@@ -88,12 +97,6 @@ Messages are sent to All Players with MESSAGE:ToAll().< - - - -
MESSAGE -
MESSAGEQUEUE -
@@ -118,7 +121,7 @@ Messages are sent to All Players with MESSAGE:ToAll().< - MESSAGE:New(MessageText, MessageCategory, MessageDuration, MessageID) + MESSAGE:New(MessageText, MessageDuration, MessageCategory)

Creates a new MESSAGE object.

@@ -151,34 +154,6 @@ Messages are sent to All Players with MESSAGE:ToAll().< MESSAGE:ToRed()

Sends a MESSAGE to the Red Coalition.

- - - - -

Type MESSAGEQUEUE

- - - - - - - - - - - - - - - -
MESSAGEQUEUE.ClientGroups - -
MESSAGEQUEUE.CoalitionSides - -
MESSAGEQUEUE:New(RefreshInterval) - -
MESSAGEQUEUE:_DisplayMessages() -

This function is called automatically by the MESSAGEQUEUE scheduler.

@@ -196,20 +171,6 @@ Messages are sent to All Players with MESSAGE:ToAll().< - - -
-
- - #MESSAGEQUEUE - -MESSAGEQUEUE - -
-
- - -

Type Message

@@ -265,7 +226,7 @@ Messages are sent to All Players with MESSAGE:ToAll().<
-MESSAGE:New(MessageText, MessageCategory, MessageDuration, MessageID) +MESSAGE:New(MessageText, MessageDuration, MessageCategory)
@@ -285,20 +246,14 @@ 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.

    +

    #string MessageCategory : +(optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ".

  • @@ -313,10 +268,10 @@ is a string expressing the ID of the Message.

    -- 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" ) +MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", 25, "End of Mission" ) +MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" ) +MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" ) +MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")
    @@ -481,74 +436,6 @@ 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() - - - -

    Type MESSAGEQUEUE

    - -

    The MESSAGEQUEUE class

    - -

    Field(s)

    -
    -
    - - - -MESSAGEQUEUE.ClientGroups - -
    -
    - - - -
    -
    -
    -
    - - - -MESSAGEQUEUE.CoalitionSides - -
    -
    - - - -
    -
    -
    -
    - - -MESSAGEQUEUE:New(RefreshInterval) - -
    -
    - - - -

    Parameter

    -
      -
    • - -

      RefreshInterval :

      - -
    • -
    -
    -
    -
    -
    - - -MESSAGEQUEUE:_DisplayMessages() - -
    -
    - -

    This function is called automatically by the MESSAGEQUEUE scheduler.

    -
    diff --git a/Moose Training/Documentation/Spawn.html b/Moose Training/Documentation/Spawn.html index dd8c1ec10..ef75c88e3 100644 --- a/Moose Training/Documentation/Spawn.html +++ b/Moose Training/Documentation/Spawn.html @@ -777,8 +777,8 @@ The index of the group to return.

    Return value

    -

    Group#GROUP:

    - +

    Group#GROUP: +self

    diff --git a/Moose Training/Documentation/index.html b/Moose Training/Documentation/index.html index 71f021a69..96be59ebe 100644 --- a/Moose Training/Documentation/index.html +++ b/Moose Training/Documentation/index.html @@ -249,7 +249,7 @@ Message -

    Message System to display Messages for Clients and Coalitions or All.

    +

    This module contains the MESSAGE class.