Jump to content

Group will not attack in zone after Cleartask


Recommended Posts

Posted

Hi MOOSE gurus! Here's what I'm trying to do... I have a group that's following my group called "Yellow_Group". What does work is that they follow my own Blue_Group perfectly using MOOSE lua code, and when I ask them to attack the enemy in the zone defined in the ME, they stop ALL tasks (following), which is what I want them to do, but then they just RTB. Funny thing is, when asked to join in a different squadron location, they cleartask perfectly, and join up. They don't attack in the zone as planned however. I would like them to engage any enemy in the zone when tasked to do so. I'm attempting to use a PatrolZone even though I'm not having the Yellow_Group actually patrol; they are just following me until asked to attack. After all the enemy have been dispatched, I'll just call them back to our squadron formation. Here's basically what the code looks like so far... Take a look at the code, and tell me what you think. I appreciate any help you can offer. Thanks!!

 

PatrolZone = ZONE:New( "UK_PATROL_ZONE" ) -- zone defined in ME .miz file

AICapZone = AI_CAP_ZONE:New( PatrolZone, 200, 10000, 325, 435 )

 

function CONTROLLABLE:ClearTasks(FGroup)

self:F2(FGroup)

local DCSControllable = self:GetDCSObject(FGroup)

if DCSControllable then

local Controller = self:_GetController(FGroup)

Controller:resetTask(FGroup)

return self

end

return nil

end

 

function GP_ATTACK_BANDITS( FGroup )

FGroup:ClearTasks()

AICapZone:SetControllable( FGroup )

AICapZone:SetEngageRange( 20000 ) -- Sets the Engage Range to 20,000 meters/10.8nm

AICapZone:__Start( 1 )

end

 

FGroup:ClearTasks() -- this is actually called in another function and IS working - the group stops ALL tasks and starts to RTB -- Then I try this call, and nothing happens -- group still is RTB

 

GP_ATTACK_BANDITS( Yellow_Group )

 

What am I doing wrong here? Any ideas? ChuckIV

"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

 

SYSTEM:

Processor - Intel® Core i9-9900KF CPU @ 3.60GHz 3600MHz water-cooled

Installed memory (RAM) - 32.0 GB

64-bit Operating System, x64-based processor

Windows 10 & DCS on SSD

Video Card - water-cooled NVIDIA GeForce RTX 2080 Ti

Internet: Cable 200Mbps 12Mbps

Posted

PLEASE REMOVE THIS POST

 

PLEASE REMOVE THIS POST - I figured out why my groups were not attacking. Thank you, ChuckIV

"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

 

SYSTEM:

Processor - Intel® Core i9-9900KF CPU @ 3.60GHz 3600MHz water-cooled

Installed memory (RAM) - 32.0 GB

64-bit Operating System, x64-based processor

Windows 10 & DCS on SSD

Video Card - water-cooled NVIDIA GeForce RTX 2080 Ti

Internet: Cable 200Mbps 12Mbps

Posted (edited)

Solution

 

I removed FGroup from the parenthesis, and it starting working.

So, instead of (FGroup) I just used (), and it worked!

 

*** In addition, I set the ROE for the groups to weapons free and no reaction to threats ***

Edited by ChuckIV
Adding more info

"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

 

SYSTEM:

Processor - Intel® Core i9-9900KF CPU @ 3.60GHz 3600MHz water-cooled

Installed memory (RAM) - 32.0 GB

64-bit Operating System, x64-based processor

Windows 10 & DCS on SSD

Video Card - water-cooled NVIDIA GeForce RTX 2080 Ti

Internet: Cable 200Mbps 12Mbps

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...