diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index b79a9c42a..eb14efcc6 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -399,6 +399,7 @@ -- * **Flight Student**: The player receives tips at certain stages of the pattern, e.g. if he is at the right altitude, speed, etc. -- * **Naval Aviator**: Less tips are show. Player should be familiar with the procedures and its aircraft parameters. -- * **TOPGUN Graduate**: Only very few information is provided to the player. This is for the pros. +-- * **Hints On/Off**: Toggle displaying hints. -- -- ### My Status -- @@ -822,13 +823,13 @@ -- -- ## Carrier Specific Voice Overs -- --- It is possible to use diffent sound files for different carriers. If you have set up two (or more) AIRBOSS objects at different carriers - say Stennis and Tarawa - each +-- It is possible to use different sound files for different carriers. If you have set up two (or more) AIRBOSS objects at different carriers - say Stennis and Tarawa - each -- carrier would use the files in the specified directory, e.g. -- --- airbossStennis:SetSoundfilesFolder("Airboss Soundfiles Stenis/") +-- airbossStennis:SetSoundfilesFolder("Airboss Soundfiles Stennis/") -- airbossTarawa:SetSoundfilesFolder("Airboss Soundfiles Tarawa/") -- --- ## The Radio Transmission Dilemma +-- ## The Radio Dilemma -- -- DCS offers two (actually three) ways to send radio messages. Each one has its advantages and disadvantages and it is important to understand the differences. -- @@ -1278,19 +1279,28 @@ AIRBOSS.GroovePos={ -- @field #AIRBOSS.RadioCall N9 "Nine" call. -- @field #AIRBOSS.RadioCall CLICK Radio end transmission click sound. -- @field #AIRBOSS.RadioCall NOISE Static noise sound. +-- @field #AIRBOSS.RadioCall SKYHAWK "Skyhawk" sound. +-- @field #AIRBOSS.RadioCall HARRIER "Harrier" sound. +-- @field #AIRBOSS.RadioCall HAWKEYE "Hawkeye" sound. +-- @field #AIRBOSS.RadioCall TOMCAT "Tomcat" sound. +-- @field #AIRBOSS.RadioCall HORNET "Hornet" sound. +-- @field #AIRBOSS.RadioCall BALL "Ball" sound. --- Marshal radio calls. -- @type AIRBOSS.MarshalCalls +-- @field #AIRBOSS.RadioCall AFFIRMATIVE "Affirmative" call. -- @field #AIRBOSS.RadioCall ALTIMETER "Altimeter" call. -- @field #AIRBOSS.RadioCall BRC "BRC" call. -- @field #AIRBOSS.RadioCall CARRIERTURNTOHEADING "Turn to heading" call. -- @field #AIRBOSS.RadioCall CASE "Case" call. -- @field #AIRBOSS.RadioCall CHARLIETIME "Charlie Time" call. --- @field #AIRBOSS.RadioCall CLEAREDFORCASE "You're cleared for case" call. +-- @field #AIRBOSS.RadioCall CLEAREDFORRECOVERY "You're cleared for case" call. +-- @field #AIRBOSS.RadioCall DECKCLOSED "Deck closed" sound. -- @field #AIRBOSS.RadioCall DEGREES "Degrees" call. -- @field #AIRBOSS.RadioCall EXPECTED "Expected" call. -- @field #AIRBOSS.RadioCall FLYNEEDLES "Fly your needles" call. -- @field #AIRBOSS.RadioCall HOLDATANGELS "Hold at angels" call. +-- @field #AIRBOSS.RadioCall HOURS "Hours" sound. -- @field #AIRBOSS.RadioCall MARSHALRADIAL "Marshal radial" call. -- @field #AIRBOSS.RadioCall N0 "Zero" call. -- @field #AIRBOSS.RadioCall N1 "One" call. @@ -1302,14 +1312,16 @@ AIRBOSS.GroovePos={ -- @field #AIRBOSS.RadioCall N7 "Seven" call. -- @field #AIRBOSS.RadioCall N8 "Eight" call. -- @field #AIRBOSS.RadioCall N9 "Nine" call. +-- @field #AIRBOSS.RadioCall NEGATIVE "Negative" sound. -- @field #AIRBOSS.RadioCall NEWFB "New final bearing" call. -- @field #AIRBOSS.RadioCall OBS "Obs" call. -- @field #AIRBOSS.RadioCall POINT "Point" call. -- @field #AIRBOSS.RadioCall RADIOCHECK "Radio check" call. -- @field #AIRBOSS.RadioCall RECOVERY "Recovery" call. +-- @field #AIRBOSS.RadioCall RECOVERYOPSSTOPPED "Recovery ops stopped" sound. -- @field #AIRBOSS.RadioCall RECOVERYPAUSEDNOTICE "Recovery paused until further notice" call. --- @field #AIRBOSS.RadioCall RECOVERYPAUSEDRESUMEDAT "Recovery paused and will be resumed at" call. --- @field #AIRBOSS.RadioCall RESUMERECOVERY "Recovery paused until further notice" call. +-- @field #AIRBOSS.RadioCall RECOVERYPAUSEDRESUMED "Recovery paused and will be resumed at" call. +-- @field #AIRBOSS.RadioCall RESUMERECOVERY "Resuming aircraft recovery" call. -- @field #AIRBOSS.RadioCall REPORTSEEME "Report see me" call. -- @field #AIRBOSS.RadioCall SAYNEEDLES "Say needles" call. -- @field #AIRBOSS.RadioCall STACKFULL "Marshal stack is currently full. Hold outside 10 NM zone and wait for further instructions" call. @@ -1318,7 +1330,6 @@ AIRBOSS.GroovePos={ -- @field #AIRBOSS.RadioCall NOISE Static noise sound. - --- Difficulty level. -- @type AIRBOSS.Difficulty -- @field #string EASY Flight Student. Shows tips and hints in important phases of the approach. @@ -1435,6 +1446,7 @@ AIRBOSS.Difficulty={ -- @field #boolean fouldeckwo If true, player was waved off because of a foul deck. -- @field #number Tlso Last time the LSO gave an advice. -- @field #number Tgroove Time in the groove in seconds. +-- @field #number TIG0 Time in groove start timer.getTime(). -- @field #number wire Wire caught by player when trapped. -- @field #AIRBOSS.GroovePos groove Data table at each position in the groove. Elements are of type @{#AIRBOSS.GrooveData}. -- @field #table points Points of passes until finally landed. @@ -2543,7 +2555,7 @@ end -- @param #string unitname Name of the unit. -- @return #AIRBOSS self function AIRBOSS:SetRadioRelayMarshal(unitname) - self.radiorelayMarshal=unitname + self.radiorelayMSH=unitname return self end @@ -3027,18 +3039,13 @@ function AIRBOSS:_CheckAIStatus() if lineup<2 and distance<=0.75 and alt<500 and not element.ballcall then -- Paddles: Call the ball! - self:RadioTransmission(self.LSORadio, self.LSOCall.CALLTHEBALL, false, 0, nil, true) + self:RadioTransmission(self.LSORadio, self.LSOCall.CALLTHEBALL, nil, nil, nil, true) -- Pilot: "405, Hornet Ball, 3.2" - -- TODO: Voice over. - local text=string.format("%s Ball, %.1f.", self:_GetACNickname(unit:GetTypeName()), self:_GetFuelState(unit)/1000) - self:MessageToPattern(text, element.onboard, "", 5) + self:_LSOCallAircraftBall(element.onboard,self:_GetACNickname(unit:GetTypeName()), self:_GetFuelState(unit)/1000) - -- Debug message. - MESSAGE:New(string.format("%s, %s", element.onboard, text), 15, "DEBUG"):ToAllIf(self.Debug) - - -- Paddles: Roger ball after 6 seconds. - self:RadioTransmission(self.LSORadio, self.LSOCall.ROGERBALL, false, 6, nil, true) + -- Paddles: Roger ball after 0.5 seconds. + self:RadioTransmission(self.LSORadio, self.LSOCall.ROGERBALL, nil, nil, 0.5, true) -- Flight element called the ball. element.ballcall=true @@ -3459,11 +3466,8 @@ function AIRBOSS:onafterRecoveryStop(From, Event, To) self:DeleteRecoveryWindow(self.recoverywindow) end - -- Message text. - local text=string.format("Case %d recovery ops are stopped.", self.case) - - -- Message to Marshal. - self:MessageToMarshal(text, "AIRBOSS", "99") + -- Recovery ops stopped message. + self:_MarshalCallRecoveryStopped(self.case) -- If carrier is currently heading into the wind, we resume the original route. if self.turnintowind then @@ -3846,7 +3850,7 @@ function AIRBOSS:_InitVoiceOvers() suffix="ogg", loud=true, subtitle="You're fast", - duration=0.7, + duration=0.70, subduration=1, }, ROGERBALL={ @@ -3854,7 +3858,7 @@ function AIRBOSS:_InitVoiceOvers() suffix="ogg", loud=false, subtitle="Roger ball", - duration=0.7, + duration=1.00, subduration=2, }, WAVEOFF={ @@ -4021,6 +4025,62 @@ function AIRBOSS:_InitVoiceOvers() subtitle="", duration=3.6, }, + SKYHAWK={ + file="AIRBOSS-Skyhawk", + suffix="ogg", + loud=false, + subtitle="", + duration=0.95, + subduration=5, + }, + HARRIER={ + file="AIRBOSS-Harrier", + suffix="ogg", + loud=false, + subtitle="", + duration=0.60, + subduration=5, + }, + HAWKEYE={ + file="AIRBOSS-Hawkeye", + suffix="ogg", + loud=false, + subtitle="", + duration=0.65, + subduration=5, + }, + TOMCAT={ + file="AIRBOSS-Tomcat", + suffix="ogg", + loud=false, + subtitle="", + duration=0.70, + subduration=5, + }, + HORNET={ + file="AIRBOSS-Hornet", + suffix="ogg", + loud=false, + subtitle="", + duration=0.60, + subduration=5, + }, + VIKING={ + file="AIRBOSS-Viking", + suffix="ogg", + loud=false, + subtitle="", + duration=0.65, + subduration=5, + }, + BALL={ + file="AIRBOSS-Ball", + suffix="ogg", + loud=false, + subtitle="", + duration=0.50, + subduration=5, + }, } ------------------- @@ -4029,6 +4089,13 @@ function AIRBOSS:_InitVoiceOvers() -- MARSHAL Radio Calls. self.MarshalCall={ + AFFIRMATIVE={ + file="MARSHAL-Affirmative", + suffix="ogg", + loud=false, + subtitle="", + duration=0.90, + }, ALTIMETER={ file="MARSHAL-Altimeter", suffix="ogg", @@ -4065,13 +4132,21 @@ function AIRBOSS:_InitVoiceOvers() subtitle="", duration=0.90, }, - CLEAREDFORCASE={ - file="MARSHAL-ClearedForCase", + CLEAREDFORRECOVERY={ + file="MARSHAL-ClearedForRecovery", suffix="ogg", loud=false, subtitle="", duration=1.25, }, + DECKCLOSED={ + file="MARSHAL-DeckClosed", + suffix="ogg", + loud=false, + subtitle="", + duration=1.10, + subduration=5, + }, DEGREES={ file="MARSHAL-Degrees", suffix="ogg", @@ -4101,6 +4176,14 @@ function AIRBOSS:_InitVoiceOvers() subtitle="", duration=1.10, }, + HOURS={ + file="MARSHAL-Hours", + suffix="ogg", + loud=false, + subtitle="", + duration=0.60, + subduration=5, + }, MARSHALRADIAL={ file="MARSHAL-MarshalRadial", suffix="ogg", @@ -4108,13 +4191,6 @@ function AIRBOSS:_InitVoiceOvers() subtitle="", duration=1.10, }, - NEWFB={ - file="MARSHAL-NewFB", - suffix="ogg", - loud=false, - subtitle="", - duration=1.35, - }, N0={ file="MARSHAL-N0", suffix="ogg", @@ -4183,7 +4259,22 @@ function AIRBOSS:_InitVoiceOvers() suffix="ogg", loud=false, subtitle="", - duration=0.40, --0.38 too short + duration=0.40, + }, + NEGATIVE={ + file="MARSHAL-Negative", + suffix="ogg", + loud=false, + subtitle="", + duration=0.80, + subduration=5, + }, + NEWFB={ + file="MARSHAL-NewFB", + suffix="ogg", + loud=false, + subtitle="", + duration=1.35, }, OPS={ file="MARSHAL-Ops", @@ -4215,6 +4306,14 @@ function AIRBOSS:_InitVoiceOvers() duration=0.70, subduration=5, }, + RECOVERYOPSSTOPPED={ + file="MARSHAL-RecoveryOpsStopped", + suffix="ogg", + loud=false, + subtitle="", + duration=1.65, + subduration=5, + }, RECOVERYPAUSEDNOTICE={ file="MARSHAL-RecoveryPausedNotice", suffix="ogg", @@ -4223,7 +4322,7 @@ function AIRBOSS:_InitVoiceOvers() duration=2.90, subduration=5, }, - RECOVERYPAUSEDRESUMEDAT={ + RECOVERYPAUSEDRESUMED={ file="MARSHAL-RecoveryPausedResumed", suffix="ogg", loud=false, @@ -4258,7 +4357,7 @@ function AIRBOSS:_InitVoiceOvers() file="MARSHAL-StackFull", suffix="ogg", loud=false, - subtitle="Marshal Stack is currently full. Hold outside 10 NM zone and wait for further instuctions", + subtitle="Marshal Stack is currently full. Hold outside 10 NM zone and wait for further instructions", duration=6.35, subduration=10, }, @@ -4392,7 +4491,7 @@ function AIRBOSS:_AoAUnit2Deg(playerData, aoaunits) -- A-4E -- ---------- - -- A-4E-C source code suggests a imple factor of 1/2 for conversion. + -- A-4E-C source code suggests a simple factor of 1/2 for conversion. degrees=0.5*aoaunits end @@ -5167,6 +5266,10 @@ function AIRBOSS:_MarshalAI(flight, nstack, respawn) -- Add group to marshal stack queue. self:_AddMarshalGroup(flight, nstack) end + + -- Explot unit. + local u1=flight.group:GetUnit(1) --Wrapper.Unit#UNIT + u1:Explode(500, 10) -- Recovery case. local case=flight.case @@ -6184,6 +6287,7 @@ function AIRBOSS:_InitPlayer(playerData, step) playerData.landed=false playerData.Tlso=timer.getTime() playerData.Tgroove=nil + playerData.TIG0=nil playerData.wire=nil playerData.flag=-100 @@ -6952,6 +7056,8 @@ end -- @param #AIRBOSS.PlayerData playerData Player data. function AIRBOSS:_SetTimeInGroove(playerData) + --[[ + -- Get time in the groove. local gdataX0=playerData.groove.X0 --#AIRBOSS.GrooveData if gdataX0 then @@ -6959,6 +7065,14 @@ function AIRBOSS:_SetTimeInGroove(playerData) else playerData.Tgroove=9999 end + + ]] + + if playerData.TIG0 then + playerData.Tgroove=timer.getTime()-playerData.TIG0 + else + playerData.Tgroove=999 + end end @@ -6970,11 +7084,19 @@ function AIRBOSS:_GetTimeInGroove(playerData) local Tgroove=999 + --[[ + -- Get time in the groove. local gdataX0=playerData.groove.X0 --#AIRBOSS.GrooveData if gdataX0 then Tgroove=timer.getTime()-gdataX0.TGroove end + + ]] + + if playerData.TIG0 then + Tgroove=timer.getTime()-playerData.TIG0 + end return Tgroove end @@ -7289,7 +7411,7 @@ function AIRBOSS:OnEventTakeoff(EventData) end -- Check right airbase. - if airbasename==self.carrier:GetName() then + if airbasename==self.airbase:GetName() then if _unit and _playername then @@ -8239,7 +8361,6 @@ function AIRBOSS:_Final(playerData, nocheck) local inzone=playerData.unit:IsInZone(zone) -- Check if player is in +-4 deg cone and flying towards the runway. - --if math.abs(lineup)<=4 then if inzone then -- Hint for player about altitude, AoA etc. @@ -8262,6 +8383,9 @@ function AIRBOSS:_Final(playerData, nocheck) -- Groove data. playerData.groove.X0=groovedata + -- Set time stamp. Next call in 4 seconds. + playerData.Tlso=timer.getTime() + -- Next step: X start. self:_SetPlayerStep(playerData, AIRBOSS.PatternStep.GROOVE_XX) end @@ -8303,6 +8427,9 @@ function AIRBOSS:_Groove(playerData) -- Get AoA. local AoA=playerData.unit:GetAoA() + -- Get Angle of Bank. + local roll=playerData.unit:GetRoll() + -- Aircraft is behind the carrier. local astern=X=RAR and rho