Merge branch 'master' into develop

This commit is contained in:
Frank 2021-04-23 13:29:37 +02:00
commit 236a69e5dc
7 changed files with 51 additions and 44 deletions

View File

@ -26,24 +26,25 @@ init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install: install:
- cmd:
# Outcomment if lua environment invalidates and needs to be reinstalled, otherwise all will run from the cache. # Outcomment if lua environment invalidates and needs to be reinstalled, otherwise all will run from the cache.
# - call choco install 7zip.commandline call choco install 7zip.commandline
# - call choco install lua51 call choco install lua51
# - call choco install luarocks call choco install luarocks
# - call refreshenv call refreshenv
# - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
# - cmd: PATH = %PATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\bin cmd: PATH = %PATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\bin
# - cmd: set LUA_PATH = %LUA_PATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\share\lua\5.1\?.lua;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\share\lua\5.1\?\init.lua cmd: set LUA_PATH = %LUA_PATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\share\lua\5.1\?.lua;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\share\lua\5.1\?\init.lua
# - cmd: set LUA_CPATH = %LUA_CPATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\lib\lua\5.1\?.dll cmd: set LUA_CPATH = %LUA_CPATH%;C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.3-win32\systree\lib\lua\5.1\?.dll
# - call luarocks install luasrcdiet call luarocks install luasrcdiet
# - call luarocks install checks call luarocks install checks
# - call luarocks install luadocumentor call luarocks install luadocumentor
# - call luarocks install luacheck call luarocks install luacheck
#cache: cache:
# - C:\ProgramData\chocolatey\lib C:\ProgramData\chocolatey\lib
# - C:\ProgramData\chocolatey\bin C:\ProgramData\chocolatey\bin
@ -51,8 +52,9 @@ build_script:
- ps: | - ps: |
if( $env:appveyor_repo_branch -eq 'master' -or $env:appveyor_repo_branch -eq 'develop' ) if( $env:appveyor_repo_branch -eq 'master' -or $env:appveyor_repo_branch -eq 'develop' )
{ {
echo "Hello World!"
$apiUrl = 'https://ci.appveyor.com/api' $apiUrl = 'https://ci.appveyor.com/api'
$token = 'qts80b5kpq0ooj4x6vvw' $token = 'v2.6hcv3ige78kg3yvg4ge8'
$headers = @{ $headers = @{
"Authorization" = "Bearer $token" "Authorization" = "Bearer $token"
"Content-type" = "application/json" "Content-type" = "application/json"
@ -65,7 +67,7 @@ build_script:
if( $env:appveyor_repo_branch -eq 'master' -or $env:appveyor_repo_branch -eq 'develop' ) if( $env:appveyor_repo_branch -eq 'master' -or $env:appveyor_repo_branch -eq 'develop' )
{ {
$apiUrl = 'https://ci.appveyor.com/api' $apiUrl = 'https://ci.appveyor.com/api'
$token = 'qts80b5kpq0ooj4x6vvw' $token = 'v2.6hcv3ige78kg3yvg4ge8'
$headers = @{ $headers = @{
"Authorization" = "Bearer $token" "Authorization" = "Bearer $token"
"Content-type" = "application/json" "Content-type" = "application/json"

2
.gitignore vendored
View File

@ -18,6 +18,8 @@ local.properties
# External tool builders # External tool builders
.externalToolBuilders/ .externalToolBuilders/
# AppVeyor
.appveyor/
# CDT-specific # CDT-specific
.cproject .cproject

View File

@ -190,7 +190,7 @@ do -- ACT_ROUTE
self:F( { ZoneName = ZoneName } ) self:F( { ZoneName = ZoneName } )
local Zone = Zone -- Core.Zone#ZONE local Zone = Zone -- Core.Zone#ZONE
local ZoneCoord = Zone:GetCoordinate() local ZoneCoord = Zone:GetCoordinate()
local ZoneDistance = ZoneCoord:Get2DDistance( self.Coordinate ) local ZoneDistance = ZoneCoord:Get2DDistance( Coordinate )
self:F( { ShortestDistance, ShortestReferenceName } ) self:F( { ShortestDistance, ShortestReferenceName } )
if ShortestDistance == 0 or ZoneDistance < ShortestDistance then if ShortestDistance == 0 or ZoneDistance < ShortestDistance then
ShortestDistance = ZoneDistance ShortestDistance = ZoneDistance

View File

@ -1226,7 +1226,7 @@ do -- Group
-- @param #Group self -- @param #Group self
-- @return #number -- @return #number
--- Returns initial size of the group. If some of the units will be destroyed, initial size of the group will not be changed. Initial size limits the unitNumber parameter for Group.getUnit() function. --- Returns initial size of the group. If some of the units will be destroyed, initial size of the group will not be changed; Initial size limits the unitNumber parameter for Group.getUnit() function.
-- @function [parent=#Group] getInitialSize -- @function [parent=#Group] getInitialSize
-- @param #Group self -- @param #Group self
-- @return #number -- @return #number

View File

@ -1429,7 +1429,7 @@ end
-- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted). -- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted).
-- @param #number WeaponType (optional) Enum for weapon type ID. This value is only required if you want the group firing to use a specific weapon, for instance using the task on a ship to force it to fire guided missiles at targets within cannon range. See http://wiki.hoggit.us/view/DCS_enum_weapon_flag -- @param #number WeaponType (optional) Enum for weapon type ID. This value is only required if you want the group firing to use a specific weapon, for instance using the task on a ship to force it to fire guided missiles at targets within cannon range. See http://wiki.hoggit.us/view/DCS_enum_weapon_flag
-- @param #number Altitude (Optional) Altitude in meters. -- @param #number Altitude (Optional) Altitude in meters.
-- @param #number ASL Altitude is above mean sea level. Default is above ground level. -- @param #number ASL Altitude is above mean sea level. Default is above ground level.
-- @return DCS#Task The DCS task structure. -- @return DCS#Task The DCS task structure.
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Altitude, ASL ) function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Altitude, ASL )
@ -1451,7 +1451,7 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Alti
DCSTask.params.expendQty = AmmoCount DCSTask.params.expendQty = AmmoCount
DCSTask.params.expendQtyEnabled = true DCSTask.params.expendQtyEnabled = true
end end
if Altitude then if Altitude then
DCSTask.params.altitude=Altitude DCSTask.params.altitude=Altitude
end end
@ -1459,7 +1459,7 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Alti
if WeaponType then if WeaponType then
DCSTask.params.weaponType=WeaponType DCSTask.params.weaponType=WeaponType
end end
self:I(DCSTask) self:I(DCSTask)
return DCSTask return DCSTask
@ -2908,7 +2908,7 @@ end
--- Set option for Rules of Engagement (ROE). --- Set option for Rules of Engagement (ROE).
-- @param Wrapper.Controllable#CONTROLLABLE self -- @param Wrapper.Controllable#CONTROLLABLE self
-- @param #number ROEvalue ROE value. See ENUMS.ROE. -- @param #number ROEvalue ROE value. See ENUMS.ROE.
-- @return Wrapper.Controllable#CONTROLLABLE self -- @return #CONTROLLABLE self
function CONTROLLABLE:OptionROE(ROEvalue) function CONTROLLABLE:OptionROE(ROEvalue)
local DCSControllable = self:GetDCSObject() local DCSControllable = self:GetDCSObject()
@ -2950,8 +2950,8 @@ function CONTROLLABLE:OptionROEHoldFirePossible()
end end
--- Weapons Hold: AI will hold fire under all circumstances. --- Weapons Hold: AI will hold fire under all circumstances.
-- @param Wrapper.Controllable#CONTROLLABLE self -- @param #CONTROLLABLE self
-- @return Wrapper.Controllable#CONTROLLABLE self -- @return #CONTROLLABLE self
function CONTROLLABLE:OptionROEHoldFire() function CONTROLLABLE:OptionROEHoldFire()
self:F2( { self.ControllableName } ) self:F2( { self.ControllableName } )
@ -3549,7 +3549,7 @@ end
-- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED! -- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED!
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param #table WayPoints If WayPoints is given, then use the route. -- @param #table WayPoints If WayPoints is given, then use the route.
-- @return #CONTROLLABLE -- @return #CONTROLLABLE self
function CONTROLLABLE:WayPointInitialize( WayPoints ) function CONTROLLABLE:WayPointInitialize( WayPoints )
self:F( { WayPoints } ) self:F( { WayPoints } )
@ -3580,7 +3580,7 @@ end
-- @param #number WayPoint The waypoint number. Note that the start waypoint on the route is WayPoint 1! -- @param #number WayPoint The waypoint number. Note that the start waypoint on the route is WayPoint 1!
-- @param #number WayPointIndex When defining multiple WayPoint functions for one WayPoint, use WayPointIndex to set the sequence of actions. -- @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. -- @param #function WayPointFunction The waypoint function to be called when the controllable moves over the waypoint. The waypoint function takes variable parameters.
-- @return #CONTROLLABLE -- @return #CONTROLLABLE self
function CONTROLLABLE:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... ) function CONTROLLABLE:WayPointFunction( WayPoint, WayPointIndex, WayPointFunction, ... )
self:F2( { WayPoint, WayPointIndex, WayPointFunction } ) self:F2( { WayPoint, WayPointIndex, WayPointFunction } )
@ -3596,7 +3596,7 @@ end
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param #number WayPoint The WayPoint from where to execute the mission. -- @param #number WayPoint The WayPoint from where to execute the mission.
-- @param #number WaitTime The amount seconds to wait before initiating the mission. -- @param #number WaitTime The amount seconds to wait before initiating the mission.
-- @return #CONTROLLABLE -- @return #CONTROLLABLE self
function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime ) function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime )
self:F( { WayPoint, WaitTime } ) self:F( { WayPoint, WaitTime } )
@ -3679,7 +3679,9 @@ end
--- Sets Controllable Option for A2A attack range for AIR FIGHTER units. --- Sets Controllable Option for A2A attack range for AIR FIGHTER units.
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param #number Defines the range: MAX_RANGE = 0, NEZ_RANGE = 1, HALF_WAY_RMAX_NEZ = 2, TARGET_THREAT_EST = 3, RANDOM_RANGE = 4. Defaults to 3. See: https://wiki.hoggitworld.com/view/DCS_option_missileAttack -- @param #number range Defines the range
-- @return #CONTROLLABLE self
-- @usage Range can be one of MAX_RANGE = 0, NEZ_RANGE = 1, HALF_WAY_RMAX_NEZ = 2, TARGET_THREAT_EST = 3, RANDOM_RANGE = 4. Defaults to 3. See: https://wiki.hoggitworld.com/view/DCS_option_missileAttack
function CONTROLLABLE:OptionAAAttackRange(range) function CONTROLLABLE:OptionAAAttackRange(range)
self:F2( { self.ControllableName } ) self:F2( { self.ControllableName } )
-- defaults to 3 -- defaults to 3
@ -3705,7 +3707,7 @@ end
-- @param #number EngageRange Engage range limit in percent (a number between 0 and 100). Default 100. -- @param #number EngageRange Engage range limit in percent (a number between 0 and 100). Default 100.
-- @return #CONTROLLABLE self -- @return #CONTROLLABLE self
function CONTROLLABLE:OptionEngageRange(EngageRange) function CONTROLLABLE:OptionEngageRange(EngageRange)
self:F2( { self.ControllableName } ) self:F2( { self.ControllableName } )
-- Set default if not specified. -- Set default if not specified.
EngageRange=EngageRange or 100 EngageRange=EngageRange or 100
if EngageRange < 0 or EngageRange > 100 then if EngageRange < 0 or EngageRange > 100 then
@ -3714,9 +3716,9 @@ function CONTROLLABLE:OptionEngageRange(EngageRange)
local DCSControllable = self:GetDCSObject() local DCSControllable = self:GetDCSObject()
if DCSControllable then if DCSControllable then
local Controller = self:_GetController() local Controller = self:_GetController()
if Controller then if Controller then
if self:IsGround() then if self:IsGround() then
self:SetOption(AI.Option.Ground.id.AC_ENGAGEMENT_RANGE_RESTRICTION, EngageRange) self:SetOption(AI.Option.Ground.id.AC_ENGAGEMENT_RANGE_RESTRICTION, EngageRange)
end end
end end
return self return self
@ -3730,10 +3732,11 @@ end
-- @param #number radius Radius of the relocation zone, default 500 -- @param #number radius Radius of the relocation zone, default 500
-- @param #boolean onroad If true, route on road (less problems with AI way finding), default true -- @param #boolean onroad If true, route on road (less problems with AI way finding), default true
-- @param #boolean shortcut If true and onroad is set, take a shorter route - if available - off road, default false -- @param #boolean shortcut If true and onroad is set, take a shorter route - if available - off road, default false
-- @return #CONTROLLABLE self
function CONTROLLABLE:RelocateGroundRandomInRadius(speed, radius, onroad, shortcut) function CONTROLLABLE:RelocateGroundRandomInRadius(speed, radius, onroad, shortcut)
self:F2( { self.ControllableName } ) self:F2( { self.ControllableName } )
local _coord = self:GetCoordinate() local _coord = self:GetCoordinate()
local _radius = radius or 500 local _radius = radius or 500
local _speed = speed or 20 local _speed = speed or 20
local _tocoord = _coord:GetRandomCoordinateInRadius(_radius,100) local _tocoord = _coord:GetRandomCoordinateInRadius(_radius,100)
@ -3741,7 +3744,7 @@ function CONTROLLABLE:RelocateGroundRandomInRadius(speed, radius, onroad, shortc
local _grptsk = {} local _grptsk = {}
local _candoroad = false local _candoroad = false
local _shortcut = shortcut or false local _shortcut = shortcut or false
-- create a DCS Task an push it on the group -- create a DCS Task an push it on the group
-- TaskGroundOnRoad(ToCoordinate,Speed,OffRoadFormation,Shortcut,FromCoordinate,WaypointFunction,WaypointFunctionArguments) -- TaskGroundOnRoad(ToCoordinate,Speed,OffRoadFormation,Shortcut,FromCoordinate,WaypointFunction,WaypointFunctionArguments)
if onroad then if onroad then
@ -3751,23 +3754,23 @@ function CONTROLLABLE:RelocateGroundRandomInRadius(speed, radius, onroad, shortc
self:TaskRouteToVec2(_tocoord:GetVec2(),_speed,"Off Road") self:TaskRouteToVec2(_tocoord:GetVec2(),_speed,"Off Road")
end end
return self return self
end end
--- Defines how long a GROUND unit/group will move to avoid an ongoing attack. --- Defines how long a GROUND unit/group will move to avoid an ongoing attack.
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param #number Seconds Any positive number: AI will disperse, but only for the specified time before continuing their route. 0: AI will not disperse. -- @param #number Seconds Any positive number: AI will disperse, but only for the specified time before continuing their route. 0: AI will not disperse.
-- @return #CONTROLLABLE self -- @return #CONTROLLABLE self
function CONTROLLABLE:OptionDisperseOnAttack(Seconds) function CONTROLLABLE:OptionDisperseOnAttack(Seconds)
self:F2( { self.ControllableName } ) self:F2( { self.ControllableName } )
-- Set default if not specified. -- Set default if not specified.
local seconds = Seconds or 0 local seconds = Seconds or 0
local DCSControllable = self:GetDCSObject() local DCSControllable = self:GetDCSObject()
if DCSControllable then if DCSControllable then
local Controller = self:_GetController() local Controller = self:_GetController()
if Controller then if Controller then
if self:IsGround() then if self:IsGround() then
self:SetOption(AI.Option.GROUND.id.DISPERSE_ON_ATTACK, seconds) self:SetOption(AI.Option.GROUND.id.DISPERSE_ON_ATTACK, seconds)
end end
end end
return self return self

View File

@ -154,7 +154,7 @@ function UNIT:Name()
return self.UnitName return self.UnitName
end end
--- Get the DCS unit object you want. --- Get the DCS unit object.
-- @param #UNIT self -- @param #UNIT self
-- @return DCS#Unit -- @return DCS#Unit
function UNIT:GetDCSObject() function UNIT:GetDCSObject()

View File

@ -1,3 +1,5 @@
[![Build status](https://ci.appveyor.com/api/projects/status/1y8nfmx7lwsn33tt?svg=true)](https://ci.appveyor.com/project/Applevangelist/MOOSE)
# MOOSE framework # MOOSE framework
MOOSE is a **M**ission **O**bject **O**riented **S**cripting **E**nvironment, and is meant for mission designers in DCS World. MOOSE is a **M**ission **O**bject **O**riented **S**cripting **E**nvironment, and is meant for mission designers in DCS World.
@ -50,9 +52,7 @@ This repository contains all the demonstration missions in packed format (*.miz)
This repository contains all the demonstration missions in unpacked format. That means that there is no .miz file included, but all the .miz contents are unpacked. This repository contains all the demonstration missions in unpacked format. That means that there is no .miz file included, but all the .miz contents are unpacked.
## [MOOSE Web Site](https://flightcontrol-master.github.io/MOOSE_DOCS/) ## [MOOSE Web Site](https://flightcontrol-master.github.io/MOOSE_DOCS/)
Documentation on the MOOSE class hierarchy, usage guides and background information can be found here for normal users, beta testers and contributors. Documentation on the MOOSE class hierarchy, usage guides and background information can be found here for normal users, beta testers and contributors.