How to STOP a task? Once done, how to change to a WP? - Page 2 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 12-04-2019, 06:16 AM   #11
ChuckIV
Junior Member
 
ChuckIV's Avatar
 
Join Date: Jul 2017
Location: Elk Grove, CA.
Posts: 44
Default

OK, I'm trying something with the resetTask() coding.... Using this code...


function CONTROLLABLE:ClearTasks()
self:F2()

local DCSControllable = self:GetDCSObject()

if DCSControllable then
local Controller = self:_GetController()
Controller:resetTask()
return self
end

return nil
end

If the controllable group is called FGroup, then should the code look something like this where the function is called in the last line??.....

function CONTROLLABLE:ClearTasks(Group)
self:F2(Group)

local DCSControllable = self:GetDCSObject(Group)

if DCSControllable then
local Controller = self:_GetController(Group)
Controller:resetTask(Group)
return self
end

return nil
end
CONTROLLABLE:ClearTasks(FGroup) -- This line calling the function ????
__________________
"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

SYSTEM:
Processor - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 4.00 GHz
Installed memory (RAM) - 32.0 GB
64-bit Operating System, x64-based processor
Windows 10 Pro on 110 GB SSD; DCS on 512 GB SSD; Backup Files on 931 GB Regular Drive
Video Card - NVIDIA GeForce GTX 1070
ChuckIV is offline   Reply With Quote
Old 12-04-2019, 07:45 AM   #12
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 2,308
Default

Quote:
Originally Posted by ChuckIV View Post
CONTROLLABLE:ClearTasks(FGroup) -- This line calling the function ????
No, it would be
Code:
FGroup:ClearTasks()
The FGroup is the CONTROLLABLE object in this case.
__________________
Multiple exclamation marks, are a sure sign of a diseased mind.
i7-8700K | Asus RTX 2080Ti Strix OC | 32 GB Ram 3200 MHz DDR-4 | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | Rift S
RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss
funkyfranky is offline   Reply With Quote
Old 12-05-2019, 02:12 AM   #13
ChuckIV
Junior Member
 
ChuckIV's Avatar
 
Join Date: Jul 2017
Location: Elk Grove, CA.
Posts: 44
Default

Is this how the code should look?? Do I leave the word CONTROLLABLE as part of the function name??

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

FGroup:ClearTasks()


******* Do I need to put FGroup where there are parenthesis ?? ****************
__________________
"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

SYSTEM:
Processor - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 4.00 GHz
Installed memory (RAM) - 32.0 GB
64-bit Operating System, x64-based processor
Windows 10 Pro on 110 GB SSD; DCS on 512 GB SSD; Backup Files on 931 GB Regular Drive
Video Card - NVIDIA GeForce GTX 1070

Last edited by ChuckIV; 12-05-2019 at 06:07 AM.
ChuckIV is offline   Reply With Quote
Old 12-06-2019, 06:04 AM   #14
ChuckIV
Junior Member
 
ChuckIV's Avatar
 
Join Date: Jul 2017
Location: Elk Grove, CA.
Posts: 44
Default Thanks funkyfranky

funkyfranky,

Thanks for you help - the lua file is working much, much, better now. The groups STOP following Blue Leader and can now be tasked with something new like RTB, ORBIT HERE, or more importantly, ATTACK!

Thanks again,
ChuckIV
__________________
"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

SYSTEM:
Processor - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 4.00 GHz
Installed memory (RAM) - 32.0 GB
64-bit Operating System, x64-based processor
Windows 10 Pro on 110 GB SSD; DCS on 512 GB SSD; Backup Files on 931 GB Regular Drive
Video Card - NVIDIA GeForce GTX 1070
ChuckIV is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:25 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.