mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed a bug in TaskFollow and TaskEscort
- In TaskFollow method, controllerId was renamed back to groupId. Did this in all required functions in the Controllable.lua where this mistake was made during renaming. - In TaskFollow method, fixed the lastWptIndexFlag bug, which needs to be set to false if lastWptIndex is not given. Did this fix also in TaskEscort method. - Made an additional test mission to demonstrate the TaskFollow API.
This commit is contained in:
parent
9126c8c0b2
commit
8c85f9319d
@ -224,6 +224,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
|||||||
if DCSControllable then
|
if DCSControllable then
|
||||||
|
|
||||||
local Controller = self:_GetController()
|
local Controller = self:_GetController()
|
||||||
|
self:E(Controller)
|
||||||
|
|
||||||
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
||||||
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
||||||
@ -418,7 +419,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
-- AttackControllable = {
|
-- AttackControllable = {
|
||||||
-- id = 'AttackControllable',
|
-- id = 'AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -443,7 +444,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'AttackControllable',
|
DCSTask = { id = 'AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -802,27 +803,28 @@ function CONTROLLABLE:TaskFollow( FollowControllable, Vec3, LastWaypointIndex )
|
|||||||
-- Follow = {
|
-- Follow = {
|
||||||
-- id = 'Follow',
|
-- id = 'Follow',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number
|
-- lastWptIndex = number
|
||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = {
|
||||||
|
id = 'Follow',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
self:T3( { DCSTask } )
|
self:T3( { DCSTask } )
|
||||||
return DCSTask
|
return DCSTask
|
||||||
@ -845,7 +847,7 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- Escort = {
|
-- Escort = {
|
||||||
-- id = 'Escort',
|
-- id = 'Escort',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number,
|
-- lastWptIndex = number,
|
||||||
@ -854,15 +856,15 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = { id = 'Escort',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex,
|
||||||
@ -946,7 +948,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
-- FAC_AttackControllable = {
|
-- FAC_AttackControllable = {
|
||||||
-- id = 'FAC_AttackControllable',
|
-- id = 'FAC_AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean
|
-- datalink = boolean
|
||||||
@ -956,7 +958,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_AttackControllable',
|
DCSTask = { id = 'FAC_AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
@ -1054,7 +1056,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
-- EngageControllable = {
|
-- EngageControllable = {
|
||||||
-- id = 'EngageControllable ',
|
-- id = 'EngageControllable ',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -1080,7 +1082,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'EngageControllable',
|
DCSTask = { id = 'EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -1235,7 +1237,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
-- FAC_EngageControllable = {
|
-- FAC_EngageControllable = {
|
||||||
-- id = 'FAC_EngageControllable',
|
-- id = 'FAC_EngageControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean,
|
-- datalink = boolean,
|
||||||
@ -1246,7 +1248,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_EngageControllable',
|
DCSTask = { id = 'FAC_EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20160812_0800' )
|
env.info( 'Moose Generation Timestamp: 20161205_1227' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -4216,6 +4216,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
|||||||
if DCSControllable then
|
if DCSControllable then
|
||||||
|
|
||||||
local Controller = self:_GetController()
|
local Controller = self:_GetController()
|
||||||
|
self:E(Controller)
|
||||||
|
|
||||||
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
||||||
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
||||||
@ -4410,7 +4411,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
-- AttackControllable = {
|
-- AttackControllable = {
|
||||||
-- id = 'AttackControllable',
|
-- id = 'AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -4435,7 +4436,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'AttackControllable',
|
DCSTask = { id = 'AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -4794,27 +4795,28 @@ function CONTROLLABLE:TaskFollow( FollowControllable, Vec3, LastWaypointIndex )
|
|||||||
-- Follow = {
|
-- Follow = {
|
||||||
-- id = 'Follow',
|
-- id = 'Follow',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number
|
-- lastWptIndex = number
|
||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = {
|
||||||
|
id = 'Follow',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
self:T3( { DCSTask } )
|
self:T3( { DCSTask } )
|
||||||
return DCSTask
|
return DCSTask
|
||||||
@ -4837,7 +4839,7 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- Escort = {
|
-- Escort = {
|
||||||
-- id = 'Escort',
|
-- id = 'Escort',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number,
|
-- lastWptIndex = number,
|
||||||
@ -4846,15 +4848,15 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = { id = 'Escort',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex,
|
||||||
@ -4938,7 +4940,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
-- FAC_AttackControllable = {
|
-- FAC_AttackControllable = {
|
||||||
-- id = 'FAC_AttackControllable',
|
-- id = 'FAC_AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean
|
-- datalink = boolean
|
||||||
@ -4948,7 +4950,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_AttackControllable',
|
DCSTask = { id = 'FAC_AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
@ -5046,7 +5048,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
-- EngageControllable = {
|
-- EngageControllable = {
|
||||||
-- id = 'EngageControllable ',
|
-- id = 'EngageControllable ',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -5072,7 +5074,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'EngageControllable',
|
DCSTask = { id = 'EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -5227,7 +5229,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
-- FAC_EngageControllable = {
|
-- FAC_EngageControllable = {
|
||||||
-- id = 'FAC_EngageControllable',
|
-- id = 'FAC_EngageControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean,
|
-- datalink = boolean,
|
||||||
@ -5238,7 +5240,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_EngageControllable',
|
DCSTask = { id = 'FAC_EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20160812_0800' )
|
env.info( 'Moose Generation Timestamp: 20161205_1227' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -4216,6 +4216,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
|||||||
if DCSControllable then
|
if DCSControllable then
|
||||||
|
|
||||||
local Controller = self:_GetController()
|
local Controller = self:_GetController()
|
||||||
|
self:E(Controller)
|
||||||
|
|
||||||
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
||||||
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
||||||
@ -4410,7 +4411,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
-- AttackControllable = {
|
-- AttackControllable = {
|
||||||
-- id = 'AttackControllable',
|
-- id = 'AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -4435,7 +4436,7 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'AttackControllable',
|
DCSTask = { id = 'AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -4794,27 +4795,28 @@ function CONTROLLABLE:TaskFollow( FollowControllable, Vec3, LastWaypointIndex )
|
|||||||
-- Follow = {
|
-- Follow = {
|
||||||
-- id = 'Follow',
|
-- id = 'Follow',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number
|
-- lastWptIndex = number
|
||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = {
|
||||||
|
id = 'Follow',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
self:T3( { DCSTask } )
|
self:T3( { DCSTask } )
|
||||||
return DCSTask
|
return DCSTask
|
||||||
@ -4837,7 +4839,7 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- Escort = {
|
-- Escort = {
|
||||||
-- id = 'Escort',
|
-- id = 'Escort',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- pos = Vec3,
|
-- pos = Vec3,
|
||||||
-- lastWptIndexFlag = boolean,
|
-- lastWptIndexFlag = boolean,
|
||||||
-- lastWptIndex = number,
|
-- lastWptIndex = number,
|
||||||
@ -4846,15 +4848,15 @@ function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, E
|
|||||||
-- }
|
-- }
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
local LastWaypointIndexFlag = nil
|
local LastWaypointIndexFlag = false
|
||||||
if LastWaypointIndex then
|
if LastWaypointIndex then
|
||||||
LastWaypointIndexFlag = true
|
LastWaypointIndexFlag = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'Follow',
|
DCSTask = { id = 'Escort',
|
||||||
params = {
|
params = {
|
||||||
controllableId = FollowControllable:GetID(),
|
groupId = FollowControllable:GetID(),
|
||||||
pos = Vec3,
|
pos = Vec3,
|
||||||
lastWptIndexFlag = LastWaypointIndexFlag,
|
lastWptIndexFlag = LastWaypointIndexFlag,
|
||||||
lastWptIndex = LastWaypointIndex,
|
lastWptIndex = LastWaypointIndex,
|
||||||
@ -4938,7 +4940,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
-- FAC_AttackControllable = {
|
-- FAC_AttackControllable = {
|
||||||
-- id = 'FAC_AttackControllable',
|
-- id = 'FAC_AttackControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean
|
-- datalink = boolean
|
||||||
@ -4948,7 +4950,7 @@ function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_AttackControllable',
|
DCSTask = { id = 'FAC_AttackControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
@ -5046,7 +5048,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
-- EngageControllable = {
|
-- EngageControllable = {
|
||||||
-- id = 'EngageControllable ',
|
-- id = 'EngageControllable ',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- expend = enum AI.Task.WeaponExpend,
|
-- expend = enum AI.Task.WeaponExpend,
|
||||||
-- attackQty = number,
|
-- attackQty = number,
|
||||||
@ -5072,7 +5074,7 @@ function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType,
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'EngageControllable',
|
DCSTask = { id = 'EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
expend = WeaponExpend,
|
expend = WeaponExpend,
|
||||||
attackQty = AttackQty,
|
attackQty = AttackQty,
|
||||||
@ -5227,7 +5229,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
-- FAC_EngageControllable = {
|
-- FAC_EngageControllable = {
|
||||||
-- id = 'FAC_EngageControllable',
|
-- id = 'FAC_EngageControllable',
|
||||||
-- params = {
|
-- params = {
|
||||||
-- controllableId = Controllable.ID,
|
-- groupId = Group.ID,
|
||||||
-- weaponType = number,
|
-- weaponType = number,
|
||||||
-- designation = enum AI.Task.Designation,
|
-- designation = enum AI.Task.Designation,
|
||||||
-- datalink = boolean,
|
-- datalink = boolean,
|
||||||
@ -5238,7 +5240,7 @@ function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponT
|
|||||||
local DCSTask
|
local DCSTask
|
||||||
DCSTask = { id = 'FAC_EngageControllable',
|
DCSTask = { id = 'FAC_EngageControllable',
|
||||||
params = {
|
params = {
|
||||||
controllableId = AttackGroup:GetID(),
|
groupId = AttackGroup:GetID(),
|
||||||
weaponType = WeaponType,
|
weaponType = WeaponType,
|
||||||
designation = Designation,
|
designation = Designation,
|
||||||
datalink = Datalink,
|
datalink = Datalink,
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
--Create Spawn Groups
|
||||||
|
local SpawnPlane1 = SPAWN:New("Plane 1")
|
||||||
|
local SpawnPlane2 = SPAWN:New("Plane 2")
|
||||||
|
|
||||||
|
--Spawn Groups into world
|
||||||
|
local GroupPlane1 = SpawnPlane1:Spawn()
|
||||||
|
--local GroupPlane1 = GROUP:FindByName( "Plane 1" )
|
||||||
|
local GroupPlane2 = SpawnPlane2:Spawn()
|
||||||
|
--local GroupPlane2 = GROUP:FindByName( "Plane 2" )
|
||||||
|
|
||||||
|
--Create Task for plane2 (follow groupPlane1 at Vec3 offset) (Note: I think I need to be using controllers here)
|
||||||
|
--i.e. cntrlPlane1 = groupPlane1.getController(groupPlane1)
|
||||||
|
|
||||||
|
local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class.
|
||||||
|
|
||||||
|
local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() )
|
||||||
|
|
||||||
|
--Activate Task (Either PushTask/SetTask?)
|
||||||
|
-- PushTask will push a task on the execution queue of the group.
|
||||||
|
-- SetTask will delete all tasks from the current group queue, and executes this task.
|
||||||
|
|
||||||
|
GroupPlane2:SetTask( FollowDCSTask, 1 )
|
||||||
|
|
||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user