Jump to content

ICLS will not start by script


Wingthor

Recommended Posts

While debugging Moose command:

CONTROLLABLE:CommandActivateICLS(Channel, UnitID, Callsign, Delay)

it turns out that the bug seems to be dcs world it self.

I have tested turning on ICLS  with example code from the hoggit code: 

    local gp = Group.getByName("CV59TF"):getController()
    gp:setCommand({id = "ActivateICLS",
          ["params"] = 
              {
               ["type"] = 131584,
               ["channel"] = 5,
               ["unitId"] = 2,
              }, 
         })

https://wiki.hoggitworld.com/view/DCS_command_activateICLS

I have a test mission attached with both Moose and Scritping Engine command to test.

Guess bug is related to other reports about th ICLS in this forum

https://forum.dcs.world/search/?q=ICLS&quick=1&type=forums_topic&nodes=486

Regards...

DEBUG_ICLS.miz

Moose framework contributor

Link to comment
Share on other sites

8 hours ago, Nealius said:

Have you tried with the Airboss script + MOOSE? ICLS triggered by Airboss scripts works normally for me both in SP and MP.

 

In your mission script can you turn the ICLS on and off, and can you change channel?

Moose framework contributor

Link to comment
Share on other sites

16 hours ago, Wingthor said:

In your mission script can you turn the ICLS on and off, and can you change channel?

When the script is loaded the ICLS is turned on with the channel and morse identifier I defined in the lua; I deleted the ICLS and TACAN Advanced Waypoint Actions for the unit in the ME.

Do you mean turn on/off and change channel multiple times in the same mission, or do you just want it on from mission start to mission end?


Edited by Nealius
Link to comment
Share on other sites

4 hours ago, Nealius said:

Do you mean turn on/off and change channel multiple times in the same mission

This one.

Natural Born Kamikaze

-------------------------

AMD Ryzen 5 3600, AMD Fatal1ty B450 Gaming K4, AMD Radeon RX 5700 XT, 32 GB RAM Corsair Vengeance LPX, PSU Modecom Volcano 750W, Logitech G940 HOTAS, Turtle Beach VelocityOne Rudder.

Link to comment
Share on other sites

In that case I'm not sure, but I do know Airboss has ICLS on/off functions in addition to the channel and morse identifier. You could set multiple triggers with a different airboss lua file for each that turns the ICLS off/on or changes the channel. 

Link to comment
Share on other sites

I have attached a test mission in initial message, which both tries the Moose function and example from hoggit. Mission starts with ICLS on, channel 1, you can turn ICLS off, but not get it back on with F10 radio menu triggered functions. Functions are called, but no ICLS on.

Test mission has been tested with latest DCS version as per 2022-06-27, and even latest version of Moose. But Moose/Airboss is not the issue here. I have not tested with Airboss, since the function should also be used elsewhere. Would be nice @Nealius if you could take a quick test with the provided mission, to rule out if anything wrong with my or @Amarok_73system.

This is the function which seems "dead":

function ACtivateByHoggit()
    env.info("DEBUG: -------------------------------- Turning ICLS ON by Hoggit function --------------------------------")
    local gp = Group.getByName("CV59TF"):getController()
    gp:setCommand({id = "ActivateICLS",
          ["params"] = 
              {
               ["type"] = 131584,
               ["channel"] = 5,
               ["unitId"] = 2,
              }, 
         })
end

 

Moose framework contributor

Link to comment
Share on other sites

On 6/29/2022 at 11:15 AM, Wingthor said:

...This is the function which seems "dead":...

Hi, it doesn't work because you set a defined number (2) as unit ID that is not the correct number. In these cases you should use a function to get the "live" ID of the unit you want.

This code does work :

function ACtivateByHoggit()
    env.info("DEBUG: -------------------------------- Turning ICLS ON by Hoggit function --------------------------------")
    local gp = Group.getByName("CV59TF"):getController()
	local UnitID = Unit.getByName("Teddy"):getID()
    gp:setCommand({id = "ActivateICLS",
          ["params"] = 
              {
               ["type"] = 131584,
               ["channel"] = 5,
               ["unitId"] = UnitID,
              }, 
         })
end

 

  • Like 1
Link to comment
Share on other sites

7 hours ago, toutenglisse said:

This code does work :

@Wingthor I'll get it for testing today, and let You know if it works in the mission we've been analyzing it.

EDIT: It works!
Translated to the Moose, the script I struggle with the issue looks as follows:
 

amarokEventHandler = {}

local tC71ILS = true

local uCVN71 = UNIT:FindByName("Teddy")

function amarokEventHandler:onEvent(event)
	if event.id == 27 then
		if event.text:upper() == "C71ILS" then
			env.info(">>>> C71ILS >>>")
			if tC71ILS == true then
				uCVN71:CommandDeactivateICLS(0)
				trigger.action.outText("I-", 1)
				tC71ILS = false
			else
				uCVN71:CommandActivateICLS(1, uCVN71:GetID(), "C71", 0)
				trigger.action.outText("I+", 1)
				tC71ILS = true
			end
			env.info(">>>> C71ILS ended. >>>")
		end
	end
end

world.addEventHandler(amarokEventHandler)

 


Edited by Amarok_73

Natural Born Kamikaze

-------------------------

AMD Ryzen 5 3600, AMD Fatal1ty B450 Gaming K4, AMD Radeon RX 5700 XT, 32 GB RAM Corsair Vengeance LPX, PSU Modecom Volcano 750W, Logitech G940 HOTAS, Turtle Beach VelocityOne Rudder.

Link to comment
Share on other sites

Indeed, it takes DCS UnitID as input. Strange why it not works with example code though:

local UnitID = Unit.getByName("Teddy"):getID()

Anyway good to know it was sorted out, glad it works.!

Wingthor

 


Edited by Wingthor

Moose framework contributor

Link to comment
Share on other sites

  • Recently Browsing   0 members

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