AFAC lasing a static object (building) - Page 2 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 05-16-2019, 11:40 AM   #11
Habu_69
Member
 
Join Date: Jul 2011
Location: USA VA
Posts: 684
Default

Indeed, the mission creator could place a static building target, which a JTAC could designate.
Habu_69 is offline   Reply With Quote
Old 05-16-2019, 01:44 PM   #12
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 398
Default

@Habu_69

Afaik, ME JTACs can't designate statics, they only designate groups.

As for CTLD, I've never used it, but according to the documentation, it can't be used to lase buildings (I assumed it meant any building, statics included).

That's why I wrote the MOOSE script
Hardcard is offline   Reply With Quote
Old 05-16-2019, 09:52 PM   #13
Rockrend
Junior Member
 
Join Date: Aug 2018
Location: Australia
Posts: 37
Default

Quote:
Originally Posted by Hardcard View Post
I've managed to make a predator drone "buddy lase" a static building (garage) for a Su-25T client, using MOOSE.

The script includes a simple F10 menu to call for laser designation and to check designation status... the lasing time is randomized, btw.

I don't see why it shouldn't work with other aircraft, provided the correct laser frequency code is used.

Test mission + script file attached.

If you find problems with it (or need further explanation), let me know

Here's the raw script, btw:
Spoiler:
local ClientGroup = GROUP:FindByName("Client")
local LasingPredator = UNIT:FindByName("Predator")
local GarageStatic = STATIC:FindByName("Garage")
local LaserFreqSu25T = 1113 -- This laser frequency code works for the following missiles: Kh29L, S-25L, Kh-25ML. Weapon launch override must be used for them to fire, though!
-- (I believe that 1688 works for GBUs in the A-10C, not sure about the Hornet, though)


local function LaseGarageRandom()

if LasingPredator ~= nil and GarageStatic:IsAlive() then

local TimeTable = {120, 180, 240, 300, 360}
local RandomTime = TimeTable[math.random(1,5)]
local RandomTimeMinutes = RandomTime / 60

LasingPredator:LaseUnit(GarageStatic, LaserFreqSu25T, RandomTime)

MESSAGE:New("Predator is lasing!\nPredator laser frequency = "..LaserFreqSu25T.."\nLasing will be active for "..RandomTimeMinutes.." minutes!",10):ToGroup(ClientGroup)

else

MESSAGE:New("Garage has already been destroyed\nWon't lase the rubble! ^^",10):ToGroup(ClientGroup)

end
end

local function LaseGarageCheck()

if LasingPredator ~= nil then

if LasingPredator:IsLasing() then

MESSAGE:New("Predator is lasing Garage!\nPredator laser frequency = "..LaserFreqSu25T,10):ToGroup(ClientGroup)

else

MESSAGE:New("Predator isn't lasing anything right now!",10):ToGroup(ClientGroup)

end
end
end

GarageStatic:HandleEvent(EVENTS.Dead)

function GarageStatic:OnEventDead(EventData)

if EventData.initiator == GarageStatic:GetDCSObject() then

MESSAGE:New("Garage has been destroyed!",10):ToGroup(ClientGroup)

end
end

PredatorMenuRoot = MENU_GROUP:New(ClientGroup,"AFAC Predator Menu")
LaseGarageRandomCommand = MENU_GROUP_COMMAND:New(ClientGroup, "Lase Garage (Random)", PredatorMenuRoot, LaseGarageRandom)
LaseGarageCheckCommand = MENU_GROUP_COMMAND:New(ClientGroup, "Lasing Status?", PredatorMenuRoot, LaseGarageCheck)
Excellent....thanks very much.
Rockrend is offline   Reply With Quote
Old 05-17-2019, 09:55 AM   #14
Majinbot
Member
 
Majinbot's Avatar
 
Join Date: May 2011
Location: Close to 51º Wing
Posts: 685
Default

Quote:
Originally Posted by Hardcard View Post
@Habu_69

Afaik, ME JTACs can't designate statics, they only designate groups.

As for CTLD, I've never used it, but according to the documentation, it can't be used to lase buildings (I assumed it meant any building, statics included).

That's why I wrote the MOOSE script
I edited a bit your lua but I need to add a "MESSAGE:New" with the static coordinates for the Hornet with the two decimal. I did it with Ctld but I'm not an expert on Moose. THX
__________________
PC: i7-8700K@4.8 - RTX 2080ti - 32GB RAM PC3200 - 970 evo 1tb - Warthog Throttle - VKB GF pro - Saitek Pro Pedals - Acer XB271HU + Dell 2713H - TrackIR5 - Oculus CV1
Majinbot is offline   Reply With Quote
Old 05-17-2019, 11:01 AM   #15
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 398
Default

@Majinbot

If you want to get the LL DDM coordinates of the static building, add the following lines to the script:

Spoiler:
local GarageCoordinatesLLDDM = GarageStatic:GetCoordinate():ToStringLLDDM() -- This will get the LL DDM coordinates for you. Add this line towards the beginning of the script, after the laser code variable, for example

-- Then you can either create a new message containing only the variable, like this:
MESSAGE:New(GarageCoordinatesLLDDM, 20):ToGroup(ClientGroup)

-- Or concatenate the variable in already existing messages, like this:
MESSAGE:New("Predator is lasing!\nPredator laser frequency = "..LaserFreqSu25T.."\nLasing will be active for "..RandomTimeMinutes.." minutes!\nTarget Coordinates = "..GarageCoordinatesLLDDM,20):ToGroup(ClientGroup)

MESSAGE:New("Predator is lasing Garage!\nPredator laser frequency = "..LaserFreqSu25T.."\nTarget Coordinates = "..GarageCoordinatesLLDDM,20):ToGroup(ClientGroup)


If you want to get the LL DMS coordinates of the static building, add the following lines to the script:

Spoiler:
local GarageCoordinatesLLDMS = GarageStatic:GetCoordinate():ToStringLLDMS() -- This will get the LL DMS coordinates for you. Add this line towards the beginning of the script, after the laser code variable, for example

-- Then you can either create a new message containing only the variable, like this:
MESSAGE:New(GarageCoordinatesLLDMS, 20):ToGroup(ClientGroup)

-- Or concatenate the variable in already existing messages, like this:
MESSAGE:New("Predator is lasing!\nPredator laser frequency = "..LaserFreqSu25T.."\nLasing will be active for "..RandomTimeMinutes.." minutes!\nTarget Coordinates = "..GarageCoordinatesLLDMS,20):ToGroup(ClientGroup)

MESSAGE:New("Predator is lasing Garage!\nPredator laser frequency = "..LaserFreqSu25T.."\nTarget Coordinates = "..GarageCoordinatesLLDMS,20):ToGroup(ClientGroup)

Last edited by Hardcard; 05-17-2019 at 11:08 AM.
Hardcard is offline   Reply With Quote
Old 05-17-2019, 08:04 PM   #16
Majinbot
Member
 
Majinbot's Avatar
 
Join Date: May 2011
Location: Close to 51º Wing
Posts: 685
Default

Quote:
Originally Posted by Hardcard View Post
@Majinbot
Thank you
__________________
PC: i7-8700K@4.8 - RTX 2080ti - 32GB RAM PC3200 - 970 evo 1tb - Warthog Throttle - VKB GF pro - Saitek Pro Pedals - Acer XB271HU + Dell 2713H - TrackIR5 - Oculus CV1
Majinbot 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 03:30 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.