Jump to content

Recommended Posts

Hi guys
I am looking for a way to turn the smokewinder on and off on an ai aircraft with LUA script. Something like this:

 

Unit.getByName('name'):setSmokewinderOn()
Unit.getByName('name'):setSmokewinderOff()

 

Does anyone know a way? In the advanced waypoint actions under execute command this is possible. However, this is not sufficient for my application.

 

Thanks for help.

Link to post
Share on other sites

Here is the corresponding LAU code if anyone can use it.

 

Variant 1:

if Unit.getByName('UnitName') then trigger.action.ctfColorTag('UnitName', Color) --Disable:0, Green:1, Red:2, Whit:3, Orange:4, Blue:5

 

Variant 2:

local gp = Group.getByName('GroupName')
if gp:getSize() > 0 then
local SMOKE_ON_OFF= {
    id = 'SMOKE_ON_OFF',
    params = {
      value = false
    }
}
gp:getController():setCommand(SMOKE_ON_OFF)
end

 

In my opinion, variant 2 looks better. However, this requires that smokewinder are mounted on the aircraft.

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...