From bfa8719ec3b8a78184984457f90e65011ecfaee8 Mon Sep 17 00:00:00 2001 From: kaltokri Date: Tue, 5 Mar 2024 22:11:20 +0100 Subject: [PATCH 1/3] Updated versions of all GitHub actions --- .github/workflows/gh-pages.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index db74f8ab0..d1b13a31c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -43,7 +43,7 @@ jobs: working-directory: docs/ - name: Setup Pages id: pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v4 - name: Build with Jekyll # Outputs to the './_site' directory by default run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" @@ -52,7 +52,7 @@ jobs: working-directory: docs/ - name: Upload artifact # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 with: path: docs/_site/ @@ -66,13 +66,13 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 check: runs-on: ubuntu-latest needs: deploy steps: - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 - run: npm install linkinator - run: npx linkinator https://flightcontrol-master.github.io/MOOSE/ --verbosity error --timeout 5000 --recurse --skip "(java.com)" --retry-errors --retry-errors-count 3 --retry-errors-jitter From 1e15509001ab95eea0783465e31442905e0659c0 Mon Sep 17 00:00:00 2001 From: kaltokri Date: Tue, 5 Mar 2024 22:29:28 +0100 Subject: [PATCH 2/3] Fixed broken link to demo mission --- .../Moose/Wrapper/Controllable.lua | 382 +++++++++--------- 1 file changed, 191 insertions(+), 191 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index a7c4e235a..89b2e995e 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -99,7 +99,7 @@ -- This method can also be used to **embed a function call when a certain waypoint has been reached**. -- See below the **Tasks at Waypoints** section. -- --- Demonstration Mission: [GRP-502 - Route at waypoint to random point](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/Wrapper/Group/GRP-502%20-%20Route%20at%20waypoint%20to%20random%20point) +-- Demonstration Mission: [GRP-502 - Route at waypoint to random point](https://github.com/FlightControl-Master/MOOSE_Demos/tree/master/Wrapper/Group/502-Route-at-waypoint-to-random-point) -- -- ## 2.5) Tasks at Waypoints -- @@ -527,7 +527,7 @@ end -- @return DCS#Task function CONTROLLABLE:TaskEmptyTask() - local DCSTaskWrappedAction = { + local DCSTaskWrappedAction = { ["id"] = "WrappedAction", ["params"] = { ["action"] = { @@ -699,12 +699,12 @@ end function CONTROLLABLE:CommandActivateACLS( UnitID, Name, Delay ) -- Command to activate ACLS system. - local CommandActivateACLS= { - id = 'ActivateACLS', + local CommandActivateACLS= { + id = 'ActivateACLS', params = { - unitId = UnitID or self:GetID(), - name = Name or "ACL", - } + unitId = UnitID or self:GetID(), + name = Name or "ACL", + } } self:T({CommandActivateACLS}) @@ -726,9 +726,9 @@ end function CONTROLLABLE:CommandDeactivateACLS( Delay ) -- Command to activate ACLS system. - local CommandDeactivateACLS= { - id = 'DeactivateACLS', - params = { } + local CommandDeactivateACLS= { + id = 'DeactivateACLS', + params = { } } if Delay and Delay > 0 then @@ -778,9 +778,9 @@ end -- @param #number Delay (Optional) Delay in seconds before the LINK4 is activated. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay) - + local freq = Frequency or 336 - + -- Command to activate Link4 system. local CommandActivateLink4= { id = "ActivateLink4", @@ -790,9 +790,9 @@ function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay) ["name"] = Callsign or "LNK", } } - + self:T({CommandActivateLink4}) - + if Delay and Delay>0 then SCHEDULER:New(nil, self.CommandActivateLink4, {self, Frequency, UnitID, Callsign}, Delay) else @@ -918,10 +918,10 @@ end function CONTROLLABLE:CommandSetUnlimitedFuel(OnOff, Delay) local CommandSetFuel = { - id = 'SetUnlimitedFuel', - params = { - value = OnOff - } + id = 'SetUnlimitedFuel', + params = { + value = OnOff + } } if Delay and Delay > 0 then @@ -966,7 +966,7 @@ end -- @param #number Frequency Radio frequency in MHz. -- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. -- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10. --- @param #UnitID UnitID (Optional, if your object is a UNIT) The UNIT ID this is for. +-- @param #UnitID UnitID (Optional, if your object is a UNIT) The UNIT ID this is for. -- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandSetFrequencyForUnit(Frequency,Modulation,Power,UnitID,Delay) @@ -1144,19 +1144,19 @@ end -- attacker:SetTask(task,2) function CONTROLLABLE:TaskStrafing( Vec2, AttackQty, Length, WeaponType, WeaponExpend, Direction, GroupAttack ) - local DCSTask = { - id = 'Strafing', - params = { + local DCSTask = { + id = 'Strafing', + params = { point = Vec2, -- req weaponType = WeaponType or 1073741822, - expend = WeaponExpend or "Auto", + expend = WeaponExpend or "Auto", attackQty = AttackQty or 1, -- req attackQtyLimit = AttackQty >1 and true or false, - direction = Direction and math.rad(Direction) or 0, + direction = Direction and math.rad(Direction) or 0, directionEnabled = Direction and true or false, - groupAttack = GroupAttack or false, - length = Length, - } + groupAttack = GroupAttack or false, + length = Length, + } } return DCSTask @@ -1495,20 +1495,20 @@ end -- @param #number LastWptNumber (optional) Waypoint of carrier group that when reached, ends the recovery tanker task -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskRecoveryTanker(CarrierGroup, Speed, Altitude, LastWptNumber) - + local LastWptFlag = type(LastWptNumber) == "number" and true or false - - local DCSTask = { + + local DCSTask = { id = "RecoveryTanker", params = { groupId = CarrierGroup:GetID(), - speed = Speed, - altitude = Altitude, - lastWptIndexFlag = LastWptFlag, + speed = Speed, + altitude = Altitude, + lastWptIndexFlag = LastWptFlag, lastWptIndex = LastWptNumber } } - + return DCSTask end @@ -1618,7 +1618,7 @@ function CONTROLLABLE:TaskGroundEscort( FollowControllable, LastWaypointIndex, O groupId = FollowControllable and FollowControllable:GetID() or nil, engagementDistMax = OrbitDistance or 2000, lastWptIndexFlag = LastWaypointIndex and true or false, - lastWptIndex = LastWaypointIndex, + lastWptIndex = LastWaypointIndex, targetTypes = TargetTypes or {"Ground vehicles"}, lastWptIndexFlagChangedManually = true, }, @@ -1811,7 +1811,7 @@ function CONTROLLABLE:EnRouteTaskAntiShip(TargetTypes, Priority) id = 'EngageTargets', key = "AntiShip", --auto = false, - --enabled = true, + --enabled = true, params = { targetTypes = TargetTypes or {"Ships"}, priority = Priority or 0 @@ -1832,7 +1832,7 @@ function CONTROLLABLE:EnRouteTaskSEAD(TargetTypes, Priority) id = 'EngageTargets', key = "SEAD", --auto = false, - --enabled = true, + --enabled = true, params = { targetTypes = TargetTypes or {"Air Defence"}, priority = Priority or 0 @@ -1853,7 +1853,7 @@ function CONTROLLABLE:EnRouteTaskCAP(TargetTypes, Priority) id = 'EngageTargets', key = "CAP", --auto = true, - enabled = true, + enabled = true, params = { targetTypes = TargetTypes or {"Air"}, priority = Priority or 0 @@ -1863,7 +1863,7 @@ function CONTROLLABLE:EnRouteTaskCAP(TargetTypes, Priority) return DCSTask end ---- (AIR) Engaging a controllable. The task does not assign the target controllable to the unit/controllable to attack now; +--- (AIR) Engaging a controllable. The task does not assign the target controllable to the unit/controllable to attack now; -- it just allows the unit/controllable to engage the target controllable as well as other assigned targets. -- See [hoggit](https://wiki.hoggitworld.com/view/DCS_task_engageGroup). -- @param #CONTROLLABLE self @@ -2004,7 +2004,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT frequency = (Frequency or 133)*1000000, modulation = Modulation or radio.modulation.AM, callname = CallsignID, - number = CallsignNumber, + number = CallsignNumber, priority = Priority or 0, }, } @@ -2013,7 +2013,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT end --- (AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose a targets (enemy ground controllable) around as well as other assigned targets. --- Assigns the controlled group to act as a Forward Air Controller or JTAC. Any detected targets will be assigned as targets to the player via the JTAC radio menu. +-- Assigns the controlled group to act as a Forward Air Controller or JTAC. Any detected targets will be assigned as targets to the player via the JTAC radio menu. -- Target designation is set to auto and is dependent on the circumstances. -- See [hoggit](https://wiki.hoggitworld.com/view/DCS_task_fac). -- @param #CONTROLLABLE self @@ -2031,7 +2031,7 @@ function CONTROLLABLE:EnRouteTaskFAC( Frequency, Modulation, CallsignID, Callsig frequency = (Frequency or 133)*1000000, modulation = Modulation or radio.modulation.AM, callname = CallsignID, - number = CallsignNumber, + number = CallsignNumber, priority = Priority or 0 } } @@ -2328,7 +2328,7 @@ function CONTROLLABLE:TaskRoute( Points ) route = {points = Points}, }, } - + return DCSTask end @@ -3800,7 +3800,7 @@ function CONTROLLABLE:OptionProhibitAfterburner( Prohibit ) return self end ---- [Air] Defines the usage of Electronic Counter Measures by airborne forces. +--- [Air] Defines the usage of Electronic Counter Measures by airborne forces. -- @param #CONTROLLABLE self -- @param #number ECMvalue Can be - 0=Never on, 1=if locked by radar, 2=if detected by radar, 3=always on, defaults to 1 -- @return #CONTROLLABLE self @@ -3825,7 +3825,7 @@ end -- @return #CONTROLLABLE self function CONTROLLABLE:OptionECM_Never() self:F2( { self.ControllableName } ) - + self:OptionECM(0) return self @@ -4184,10 +4184,10 @@ function CONTROLLABLE:IsSubmarine() end ---- Sets the controlled group to go at the specified speed in meters per second. +--- Sets the controlled group to go at the specified speed in meters per second. -- @param #CONTROLLABLE self -- @param #number Speed Speed in meters per second --- @param #boolean Keep (Optional) When set to true, will maintain the speed on passing waypoints. If not present or false, the controlled group will return to the speed as defined by their route. +-- @param #boolean Keep (Optional) When set to true, will maintain the speed on passing waypoints. If not present or false, the controlled group will return to the speed as defined by their route. -- @return #CONTROLLABLE self function CONTROLLABLE:SetSpeed(Speed, Keep) self:F2( { self.ControllableName } ) @@ -4206,7 +4206,7 @@ end --- [AIR] Sets the controlled aircraft group to fly at the specified altitude in meters. -- @param #CONTROLLABLE self -- @param #number Altitude Altitude in meters. --- @param #boolean Keep (Optional) When set to true, will maintain the altitude on passing waypoints. If not present or false, the controlled group will return to the altitude as defined by their route. +-- @param #boolean Keep (Optional) When set to true, will maintain the altitude on passing waypoints. If not present or false, the controlled group will return to the altitude as defined by their route. -- @param #string AltType (Optional) Specifies the altitude type used. If nil, the altitude type of the current waypoint will be used. Accepted values are "BARO" and "RADIO". -- @return #CONTROLLABLE self function CONTROLLABLE:SetAltitude(Altitude, Keep, AltType) @@ -4231,7 +4231,7 @@ end -- @usage -- local plane = GROUP:FindByName("Aerial-1") -- -- get a task shell --- local aerotask = plane:TaskAerobatics() +-- local aerotask = plane:TaskAerobatics() -- -- add a series of maneuvers -- aerotask = plane:TaskAerobaticsHorizontalEight(aerotask,1,5000,850,true,false,1,70) -- aerotask = plane:TaskAerobaticsWingoverFlight(aerotask,1,0,0,true,true,20) @@ -4246,7 +4246,7 @@ function CONTROLLABLE:TaskAerobatics() ["maneuversSequency"] = {}, }, ["enabled"] = true, - ["auto"] = false, + ["auto"] = false, } return DCSTaskAerobatics @@ -4262,15 +4262,15 @@ end -- @param #boolean StartImmediately (Optional) If true, start immediately and ignore InitAltitude and InitSpeed. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsCandle(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local CandleTask = { ["name"] = "CANDLE", ["params"] = { @@ -4298,9 +4298,9 @@ function CONTROLLABLE:TaskAerobaticsCandle(TaskAerobatics,Repeats,InitAltitude,I } } } - + table.insert(TaskAerobatics.params["maneuversSequency"],CandleTask) - + return TaskAerobatics end @@ -4316,20 +4316,20 @@ end -- @param #number Side (Optional) On which side to fly, 0 == left, 1 == right side, defaults to 0. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsEdgeFlight(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,FlightTime,Side) - + local maxrepeats = 10 local maxflight = 200 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local flighttime = FlightTime or 10 - + if flighttime > 200 then maxflight = flighttime end - + local EdgeTask = { ["name"] = "EDGE_FLIGHT", ["params"] = { @@ -4368,9 +4368,9 @@ function CONTROLLABLE:TaskAerobaticsEdgeFlight(TaskAerobatics,Repeats,InitAltitu }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],EdgeTask) - + return TaskAerobatics end @@ -4385,20 +4385,20 @@ end -- @param #number FlightTime (Optional) Time to fly this manoever in seconds, defaults to 10. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsWingoverFlight(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,FlightTime) - + local maxrepeats = 10 local maxflight = 200 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local flighttime = FlightTime or 10 - + if flighttime > 200 then maxflight = flighttime end - + local WingoverTask = { ["name"] = "WINGOVER_FLIGHT", ["params"] = { @@ -4433,9 +4433,9 @@ function CONTROLLABLE:TaskAerobaticsWingoverFlight(TaskAerobatics,Repeats,InitAl }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],WingoverTask) - + return TaskAerobatics end @@ -4449,15 +4449,15 @@ end -- @param #boolean StartImmediately (Optional) If true, start immediately and ignore InitAltitude and InitSpeed. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsLoop(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local LoopTask = { ["name"] = "LOOP", ["params"] = { @@ -4485,9 +4485,9 @@ function CONTROLLABLE:TaskAerobaticsLoop(TaskAerobatics,Repeats,InitAltitude,Ini } } } - + table.insert(TaskAerobatics.params["maneuversSequency"],LoopTask) - + return TaskAerobatics end @@ -4503,15 +4503,15 @@ end -- @param #number RollDeg (Optional) Roll degrees for Roll 1 and 2, defaults to 60. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsHorizontalEight(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side,RollDeg) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local LoopTask = { ["name"] = "HORIZONTAL_EIGHT", ["params"] = { @@ -4549,12 +4549,12 @@ function CONTROLLABLE:TaskAerobaticsHorizontalEight(TaskAerobatics,Repeats,InitA ["order"] = 8, ["value"] = RollDeg or 60, }, - + } } - + table.insert(TaskAerobatics.params["maneuversSequency"],LoopTask) - + return TaskAerobatics end @@ -4569,15 +4569,15 @@ end -- @param #number Side (Optional) On which side to fly, 0 == left, 1 == right side, defaults to 0. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsHammerhead(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "HUMMERHEAD", ["params"] = { @@ -4606,12 +4606,12 @@ function CONTROLLABLE:TaskAerobaticsHammerhead(TaskAerobatics,Repeats,InitAltitu ["SIDE"] = { ["order"] = 6, ["value"] = Side or 0, - }, + }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4627,15 +4627,15 @@ end -- @param #number RollDeg (Optional) Roll degrees for Roll 1 and 2, defaults to 60. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsSkewedLoop(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side,RollDeg) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "SKEWED_LOOP", ["params"] = { @@ -4668,12 +4668,12 @@ function CONTROLLABLE:TaskAerobaticsSkewedLoop(TaskAerobatics,Repeats,InitAltitu ["SIDE"] = { ["order"] = 7, ["value"] = Side or 0, - }, + }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4691,15 +4691,15 @@ end -- @param #number Angle (Optional) How many degrees to turn, defaults to 180. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsTurn(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side,RollDeg,Pull,Angle) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "TURN", ["params"] = { @@ -4740,12 +4740,12 @@ function CONTROLLABLE:TaskAerobaticsTurn(TaskAerobatics,Repeats,InitAltitude,Ini ["SIDE"] = { ["order"] = 9, ["value"] = Side or 0, - }, + }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4761,19 +4761,19 @@ end -- @param #number FinalAltitude (Optional) Final altitude in meters, defaults to 1000. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsDive(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Angle,FinalAltitude) - + local maxrepeats = 10 - + local angle = Angle - + if angle < 15 then angle = 15 elseif angle > 90 then angle = 90 end - + if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "DIVE", ["params"] = { @@ -4809,12 +4809,12 @@ function CONTROLLABLE:TaskAerobaticsDive(TaskAerobatics,Repeats,InitAltitude,Ini ["FinalAltitude"] = { ["order"] = 7, ["value"] = FinalAltitude or 1000, - }, + }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4828,15 +4828,15 @@ end -- @param #boolean StartImmediately (Optional) If true, start immediately and ignore InitAltitude and InitSpeed. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsMilitaryTurn(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "MILITARY_TURN", ["params"] = { @@ -4864,9 +4864,9 @@ function CONTROLLABLE:TaskAerobaticsMilitaryTurn(TaskAerobatics,Repeats,InitAlti } } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4880,15 +4880,15 @@ end -- @param #boolean StartImmediately (Optional) If true, start immediately and ignore InitAltitude and InitSpeed. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsImmelmann(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "IMMELMAN", ["params"] = { @@ -4916,9 +4916,9 @@ function CONTROLLABLE:TaskAerobaticsImmelmann(TaskAerobatics,Repeats,InitAltitud } } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -4933,23 +4933,23 @@ end -- @param #number FlightTime (Optional) Time to fly this manoever in seconds, defaults to 10. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsStraightFlight(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,FlightTime) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local maxflight = 200 if Repeats > maxrepeats then maxrepeats = Repeats end - + local flighttime = FlightTime or 10 - + if flighttime > 200 then maxflight = flighttime end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "STRAIGHT_FLIGHT", ["params"] = { @@ -4984,9 +4984,9 @@ function CONTROLLABLE:TaskAerobaticsStraightFlight(TaskAerobatics,Repeats,InitAl }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5002,15 +5002,15 @@ end -- @param #number FinalAltitude (Optional) Altitude to climb to in meters. Defaults to 5000m. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsClimb(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Angle,FinalAltitude) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "CLIMB", ["params"] = { @@ -5049,9 +5049,9 @@ function CONTROLLABLE:TaskAerobaticsClimb(TaskAerobatics,Repeats,InitAltitude,In }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5070,17 +5070,17 @@ end -- @param #number Angle (Optional) Angle to spiral. Can be between 15 and 90 degrees. Defaults to 45 degrees. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsSpiral(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,TurnAngle,Roll,Side,UpDown,Angle) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 local updown = UpDown and 1 or 0 local side = Side and 1 or 0 - + local Task = { ["name"] = "SPIRAL", ["params"] = { @@ -5121,7 +5121,7 @@ function CONTROLLABLE:TaskAerobaticsSpiral(TaskAerobatics,Repeats,InitAltitude,I ["UPDOWN"] = { ["order"] = 9, ["value"] = updown or 0, - }, + }, ["Angle"] = { ["max_v"] = 90, ["min_v"] = 15, @@ -5131,9 +5131,9 @@ function CONTROLLABLE:TaskAerobaticsSpiral(TaskAerobatics,Repeats,InitAltitude,I }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5148,21 +5148,21 @@ end -- @param #number FinalSpeed (Optional) Final speed to reach in KPH. Defaults to 500 kph. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsSplitS(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,FinalSpeed) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local maxflight = 200 if Repeats > maxrepeats then maxrepeats = Repeats end - + local finalspeed = FinalSpeed or 500 - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "SPLIT_S", ["params"] = { @@ -5194,9 +5194,9 @@ function CONTROLLABLE:TaskAerobaticsSplitS(TaskAerobatics,Repeats,InitAltitude,I }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5214,19 +5214,19 @@ end -- @param #number FixAngle (Optional) No idea what this does, can be between 0 and 180 degrees, defaults to 180. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsAileronRoll(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side,RollRate,TurnAngle,FixAngle) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local maxflight = 200 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "AILERON_ROLL", ["params"] = { @@ -5276,9 +5276,9 @@ function CONTROLLABLE:TaskAerobaticsAileronRoll(TaskAerobatics,Repeats,InitAltit }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5296,18 +5296,18 @@ end -- @param #number MinSpeed (Optional) Minimum speed to keep in kph, defaults to 250 kph. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsForcedTurn(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,TurnAngle,Side,FlightTime,MinSpeed) - + local maxrepeats = 10 local flighttime = FlightTime or 30 local maxtime = 200 if flighttime > 200 then maxtime = flighttime end - + if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "FORCED_TURN", ["params"] = { @@ -5357,9 +5357,9 @@ function CONTROLLABLE:TaskAerobaticsForcedTurn(TaskAerobatics,Repeats,InitAltitu }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end @@ -5376,15 +5376,15 @@ end -- @param #number TurnAngle (Optional) Turn angle, defaults to 360 degrees. -- @return DCS#Task function CONTROLLABLE:TaskAerobaticsBarrelRoll(TaskAerobatics,Repeats,InitAltitude,InitSpeed,UseSmoke,StartImmediately,Side,RollRate,TurnAngle) - + local maxrepeats = 10 if Repeats > maxrepeats then maxrepeats = Repeats end - + local usesmoke = UseSmoke and 1 or 0 - + local startimmediately = StartImmediately and 1 or 0 - + local Task = { ["name"] = "BARREL_ROLL", ["params"] = { @@ -5413,7 +5413,7 @@ function CONTROLLABLE:TaskAerobaticsBarrelRoll(TaskAerobatics,Repeats,InitAltitu ["SIDE"] = { ["order"] = 6, ["value"] = Side or 0, - }, + }, ["RollRate"] = { ["max_v"] = 450, ["min_v"] = 15, @@ -5427,13 +5427,13 @@ function CONTROLLABLE:TaskAerobaticsBarrelRoll(TaskAerobatics,Repeats,InitAltitu }, } } - + table.insert(TaskAerobatics.params["maneuversSequency"],Task) - + return TaskAerobatics end - + --- [Air] Make an airplane or helicopter patrol between two points in a racetrack - resulting in a much tighter track around the start and end points. -- @param #CONTROLLABLE self -- @param Core.Point#COORDINATE Point1 Start point. @@ -5447,23 +5447,23 @@ end function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation, AGL, Delay) local PatrolGroup = self -- Wrapper.Group#GROUP - + if not self:IsInstanceOf( "GROUP" ) then PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP end - + local delay = Delay or 1 - + self:F( { PatrolGroup = PatrolGroup:GetName() } ) - - if PatrolGroup:IsAir() then + + if PatrolGroup:IsAir() then if Formation then PatrolGroup:SetOption(AI.Option.Air.id.FORMATION,Formation) -- https://wiki.hoggitworld.com/view/DCS_option_formation end - + local FromCoord = PatrolGroup:GetCoordinate() local ToCoord = Point1:GetCoordinate() - + -- Calculate the new Route if Altitude then local asl = true @@ -5471,16 +5471,16 @@ function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation FromCoord:SetAltitude(Altitude, asl) ToCoord:SetAltitude(Altitude, asl) end - + -- Create a "air waypoint", which is a "point" structure that can be given as a parameter to a Task - local Route = {} + local Route = {} Route[#Route + 1] = FromCoord:WaypointAir( AltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, description, timeReFuAr ) Route[#Route + 1] = ToCoord:WaypointAir( AltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, description, timeReFuAr ) - + local TaskRouteToZone = PatrolGroup:TaskFunction( "CONTROLLABLE.PatrolRaceTrack", Point2, Point1, Altitude, Speed, Formation, Delay ) PatrolGroup:SetTaskWaypoint( Route[#Route], TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone. PatrolGroup:Route( Route, Delay ) -- Move after delay seconds to the Route. See the Route method for details. end - + return self end From cb61177252919124cb8ac538a39ea9f862b83e06 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 7 Mar 2024 10:20:27 +0100 Subject: [PATCH 3/3] CSAR/CTLD basic support for MH-60R --- Moose Development/Moose/Ops/CSAR.lua | 3 ++- Moose Development/Moose/Ops/CTLD.lua | 3 ++- Moose Development/Moose/Utilities/Utils.lua | 5 +++++ Moose Development/Moose/Wrapper/Controllable.lua | 16 +++++++++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/CSAR.lua b/Moose Development/Moose/Ops/CSAR.lua index 5ecc2c4c8..f1d366ca4 100644 --- a/Moose Development/Moose/Ops/CSAR.lua +++ b/Moose Development/Moose/Ops/CSAR.lua @@ -290,10 +290,11 @@ CSAR.AircraftType["Bell-47"] = 2 CSAR.AircraftType["UH-60L"] = 10 CSAR.AircraftType["AH-64D_BLK_II"] = 2 CSAR.AircraftType["Bronco-OV-10A"] = 2 +CSAR.AircraftType["MH-60R"] = 10 --- CSAR class version. -- @field #string version -CSAR.version="1.0.19" +CSAR.version="1.0.20" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ToDo list diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 9124f3c94..e571e5cd0 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1226,13 +1226,14 @@ CTLD.UnitTypeCapabilities = { ["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000}, -- 19t cargo, 64 paratroopers. --Actually it's longer, but the center coord is off-center of the model. ["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats + ["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats ["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200}, -- 2 ppl **outside** the helo ["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450}, } --- CTLD class version. -- @field #string version -CTLD.version="1.0.47" +CTLD.version="1.0.48" --- Instantiate a new CTLD. -- @param #CTLD self diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index ec50854a0..25cfb7853 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -2237,6 +2237,11 @@ function UTILS.IsLoadingDoorOpen( unit_name ) return true -- no doors on this one ;) end + if type_name == "MH-60R" and (unit:getDrawArgumentValue(403) > 0 or unit:getDrawArgumentValue(403) == -1) then + BASE:T(unit_name .. " cargo door is open") + return true + end + return false end -- nil diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 89b2e995e..696cdb15b 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -3871,6 +3871,10 @@ end -- @param #CONTROLLABLE self -- @param #table WayPoints If WayPoints is given, then use the route. -- @return #CONTROLLABLE self +-- @usage Intended Workflow is: +-- mygroup:WayPointInitialize() +-- mygroup:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... ) +-- mygroup:WayPointExecute() function CONTROLLABLE:WayPointInitialize( WayPoints ) self:F( { WayPoints } ) @@ -3902,9 +3906,15 @@ end -- @param #number WayPointIndex When defining multiple WayPoint functions for one WayPoint, use WayPointIndex to set the sequence of actions. -- @param #function WayPointFunction The waypoint function to be called when the controllable moves over the waypoint. The waypoint function takes variable parameters. -- @return #CONTROLLABLE self +-- @usage Intended Workflow is: +-- mygroup:WayPointInitialize() +-- mygroup:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... ) +-- mygroup:WayPointExecute() function CONTROLLABLE:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... ) self:F2( { WayPoint, WayPointIndex, WayPointFunction } ) - + if not self.WayPoints then + self:WayPointInitialize() + end table.insert( self.WayPoints[WayPoint].task.params.tasks, WayPointIndex ) self.WayPoints[WayPoint].task.params.tasks[WayPointIndex] = self:TaskFunction( WayPointFunction, arg ) return self @@ -3917,6 +3927,10 @@ end -- @param #number WayPoint The WayPoint from where to execute the mission. -- @param #number WaitTime The amount seconds to wait before initiating the mission. -- @return #CONTROLLABLE self +-- @usage Intended Workflow is: +-- mygroup:WayPointInitialize() +-- mygroup:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... ) +-- mygroup:WayPointExecute() function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime ) self:F( { WayPoint, WaitTime } )