Zarma Posted November 15, 2017 Posted November 15, 2017 (edited) Hi guys. I am using a modified version of the CASCAP mission by Jinx (LINK) I wanted to add a Reaper working as JTAC that would orbit at the bullseye and fly to the "Red Target Group" when a spawn is asked. I tried using the FAC_EngageGroup command, added at the end of the spawn script, without success : FAC_EngageGroup = { id = 'JTAC', params = { groupId = 'Red Target Group', designation = Auto, datalink = true, priority = 0 } } JTAC is the group name from the Reaper. Any help would be appreciated as I really dont masterize Scripting ! Edited November 15, 2017 by Zarma i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Zarma Posted November 16, 2017 Author Posted November 16, 2017 60 views, no answer sad :/ i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Grimes Posted November 17, 2017 Posted November 17, 2017 You misunderstood some of the syntax and formatting. id under task is a string for the task name. groupId is a number for the groups id, which can bet retrived via the Group.getByName('whatever'):getID() Assigning a task is done via what is called a "controller" object And then either setTask() or pushTask() to the controller. Something like this: local jtac = Group.getByName('JTAC') local target = Group.getByName('Red Target Group'):getID() local task = { id = 'FAC_EngageGroup', params = { groupId = target, designation = 'Auto', datalink = true, }, } jtac:getConroller():pushTask(task) 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
Zarma Posted November 17, 2017 Author Posted November 17, 2017 Thanks ! I will try this week-end. i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Zarma Posted November 17, 2017 Author Posted November 17, 2017 Made a quick test it's working. Just corrected getConroller to getController. Was also able to send the UAV to orbit over the target and designate by laser for M2K and F5E. Thanks a lot !!! i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Zarma Posted November 19, 2017 Author Posted November 19, 2017 Almost working. The trouble is, the Reaper go orbit on the target the first time I use the script, but then doesn't leave the spot the 2nd or 3rd time I use it, when the first group is destroyed : local jtac = Group.getByName('JTAC (137 AM)') local target = Group.getByName('Red Target Group'):getID() local Orbit = { id = 'Orbit', params = { pattern = 'Circle', point = unitSpawnZone, altitude = 5000 } } jtac:getController():pushTask(Orbit) local task = { id = 'FAC_EngageGroup', params = { groupId = target, weaponType = 2956984318, designation = 'Laser', datalink = true, }, } jtac:getController():pushTask(task) local SetInvisible = { id = 'SetInvisible', params = { value = true } } jtac:getController():setCommand(SetInvisible) local SetImmortal = { id = 'SetImmortal', params = { value = true } } jtac:getController():setCommand(SetImmortal) i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Zarma Posted November 19, 2017 Author Posted November 19, 2017 OK used a popTask command I found in one of your old posts. i9 9900k, 64 Go RAM, RTX 4090, Warthog HOTAS Throttle & Stick, Virpil AH64 collective, TPR rudder, MFD Cougar, Trackir 5 Pro, Multipurpose UFC, Alain Dufour's TEDAC and Oculus Rift S (when I want some VR), http://www.twitch.tv/zarma4074 / https://www.youtube.com/user/Zarma4074
Recommended Posts