Kleinbart Posted March 27, 2021 Posted March 27, 2021 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.
Grimes Posted March 27, 2021 Posted March 27, 2021 Gotta use a controller to set a command. https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
toutenglisse Posted March 27, 2021 Posted March 27, 2021 (edited) 47 minutes ago, Kleinbart said: ...Does anyone know a way? ... yes here (smokewinder is not necessary) : DCS func ctfColorTag - DCS World Wiki - Hoggitworld.com Edit : Grimes' one is spot on your request Edited March 27, 2021 by toutenglisse
Kleinbart Posted March 27, 2021 Author Posted March 27, 2021 That's exactly wath I was looking for. Thanks a lot guys
Kleinbart Posted March 28, 2021 Author Posted March 28, 2021 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. 1
Recommended Posts