Jump to content

How to make Reaper drone follow moving ground units


FoxTrotAlpha691

Recommended Posts

I have been able to get the Reaper drone to lase and mark targets with no issue. I am interested in making a ground attack mission with moving tanks and want to know is there a way to get the Reaper to follow a moving enemy ground unit? If I choose orbit only Circle and Racetrack are available and eventually the enemy move out of the area covered by the orbit. Any assistance is appreciated.

Link to comment
Share on other sites

I’ve got the code for it but not at computer atm, but basicaly you make a script that gets the target groups position every minute or so (faster is not needed) and orders the reaper to orbit that point.

 

 

 

 

Yes that is exactly what I am looking for, if you would share that script I would greatly appreciate it.

Link to comment
Share on other sites

Moose script:

 

function Reaper1GroupOrbit()

local RTGroup = RedTargetGroup

local RTUnit = RTGroup:GetUnit(1)

local RTPointVec2 = RTUnit:GetPointVec2()

local RTVec2 = RTPointVec2:GetVec2()

local Reaper1Orbit = Reaper1Group:TaskOrbitCircleAtVec2(RTVec2,3352,200)

Reaper1Group:SetTask(Reaper1Orbit, 1)

end

 

For non Moose, look here: https://forums.eagle.ru/showthread.php?t=167439&highlight=reaper+orbit

Link to comment
Share on other sites

Moose script:

 

function Reaper1GroupOrbit()

local RTGroup = RedTargetGroup

local RTUnit = RTGroup:GetUnit(1)

local RTPointVec2 = RTUnit:GetPointVec2()

local RTVec2 = RTPointVec2:GetVec2()

local Reaper1Orbit = Reaper1Group:TaskOrbitCircleAtVec2(RTVec2,3352,200)

Reaper1Group:SetTask(Reaper1Orbit, 1)

end

 

For non Moose, look here: https://forums.eagle.ru/showthread.php?t=167439&highlight=reaper+orbit

 

 

 

 

Thank you for getting back to me sir I really appreciate it. The first script to get the Reaper to lase starts with Time More than 8 seconds, should I just create a Do Script and set a timer for 10 seconds or so? Thanks again for responding, salute! Also I am using MIST and the JTACLase script.

Link to comment
Share on other sites

You need to re-run the script every now and then to update the Reapers orbit point. There are multiple ways of doing this.

 

You are exactly where I was a couple of years ago. I highly recommend start using Moose as soon as you can.

 

If you want to look at some different AI control functions the download Operation Titan Angel, start the mission and launch a Reaper and see what it can do. If you like a certain function then just dissect the mission code.

Link to comment
Share on other sites

  • 2 weeks later...
You need to re-run the script every now and then to update the Reapers orbit point. There are multiple ways of doing this.

 

You are exactly where I was a couple of years ago. I highly recommend start using Moose as soon as you can.

 

If you want to look at some different AI control functions the download Operation Titan Angel, start the mission and launch a Reaper and see what it can do. If you like a certain function then just dissect the mission code.

 

 

 

 

Ok thanks for the help, the script worked initially but now the Reaper goes to the waypoint I set for it near the tanks, lases once as it is coming in then flies over the tanks and just keeps going. Here are the triggers I have set and this is the code I used:

 

 

local ReaperGroup = GROUP:FindByName( "JTAC1" )

local EnemyUnit = UNIT:FindByName( "MOVING TANKS" )

local OrbitTask = ReaperGroup:TaskOrbitCircleAtVec2( EnemyUnit:GetPointVec2(), 1000, 300 )

ReaperGroup:PushTask( OrbitTask )

 

 

The last line says PushTask but the site interpreted that as an emoji, jeez.

1700470796_reapernogo.thumb.JPG.1b4e8d0b9ba7b1d1d0ffd970c963e560.JPG


Edited by FALT691
Link to comment
Share on other sites

 

 

 

 

Excellent, thank you for this information I really appreciate it. So I need to set a Do Script trigger for this scheduler to run after the Reaper script? Also I notice that this scheduler has 'Predator' instead of Reaper, is the Predator better for this task or does it matter? Thanks again for responding, salute!

Link to comment
Share on other sites

Excellent, thank you for this information I really appreciate it. So I need to set a Do Script trigger for this scheduler to run after the Reaper script? Also I notice that this scheduler has 'Predator' instead of Reaper, is the Predator better for this task or does it matter? Thanks again for responding, salute!

 

Doesnt matter what drone you'll use, only change:

 

local Predator = UNIT:FindByName("[color="Red"]drone[/color]")  [color="Red"]-- reaper unit name[/color]

local TestScheduler = SCHEDULER:New( nil, 
 function() -- t
 local Coordinate = UNIT:FindByName("[color="red"]enemy[/color]"):GetVec2() [color="red"]-- tank unit name[/color]
 local DCSTask = Predator:TaskOrbitCircleAtVec2(Coordinate, 2500, 40)
 Predator:PushTask(DCSTask, 1)
 end, {}, 1, 5
)

PC: i7-13700K - MSI RTX 4080 Gaming X Trio - 32GB DDR5 6200 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + Acer XB271HU - TrackIR5 - Rift S

Link to comment
Share on other sites

Doesnt matter what drone you'll use, only change:

 

local Predator = UNIT:FindByName("[color=Red]drone[/color]")  [color=Red]-- reaper unit name[/color]

local TestScheduler = SCHEDULER:New( nil, 
 function() -- t
 local Coordinate = UNIT:FindByName("[color=red]enemy[/color]"):GetVec2() [color=red]-- tank unit name[/color]
 local DCSTask = Predator:TaskOrbitCircleAtVec2(Coordinate, 2500, 40)
 Predator:PushTask(DCSTask, 1)
 end, {}, 1, 5
)

 

 

 

 

Ok great, I will change both scripts to say local Predator, use the Reaper type drone, and add in the drone name and tank unit name and give it a try. Thanks again for the help.

Link to comment
Share on other sites

Ok great, I will change both scripts to say local Predator, use the Reaper type drone, and add in the drone name and tank unit name and give it a try. Thanks again for the help.

 

 

 

 

Ok so I put in the new scheduler code and the drone is still flying over the targets once, lasing and marking with smoke, then flies out of the target area and tries to land at Sharjah with no RTB task set and only one WPT near the targets that has no task set on it. Not sure what I'm doing wrong but this is not working at all.

388353446_REAPERNOGO.thumb.png.83dacdc94fd7ae20b0459158e6361127.png

1579727672_REAPERSCHEDULERTRIGGER.thumb.JPG.d421508c462503f5b3ed17f0294446ae.JPG

Link to comment
Share on other sites

UPDATE: Just created new mission with only the drone and the moving tanks in it to eliminate any possible corruption of the old mission which has been edited many times. Got the same result, the drone flew over once, marked targets then proceeded out of the target area and landed at Al Minhad even though this was an air start with no waypoint set at Al Minhad.

1018305297_NOGO2.thumb.png.6d1e485ed8a5c117741f568d1f8a3f72.png

Link to comment
Share on other sites

UPDATE: Just created new mission with only the drone and the moving tanks in it to eliminate any possible corruption of the old mission which has been edited many times. Got the same result, the drone flew over once, marked targets then proceeded out of the target area and landed at Al Minhad even though this was an air start with no waypoint set at Al Minhad.

 

Can you post the mission, I tested the script and it was working...

PC: i7-13700K - MSI RTX 4080 Gaming X Trio - 32GB DDR5 6200 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + Acer XB271HU - TrackIR5 - Rift S

Link to comment
Share on other sites

Sure no problem, I'm sure its something I'm not doing. I'm new to dcs in general so its probably a syntax error that I cannot find.

 

You loaded 2 different scripts for the same purpose, and then entered the names of the groups not the units...

NEW_PG_REAPER_MOVING-TARGET_TEST.miz

PC: i7-13700K - MSI RTX 4080 Gaming X Trio - 32GB DDR5 6200 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + Acer XB271HU - TrackIR5 - Rift S

Link to comment
Share on other sites

You loaded 2 different scripts for the same purpose, and then entered the names of the groups not the units...

 

 

 

 

Ok so if I am using the scheduler I do not need the other script? I thought I needed them both, one to set the task and then the scheduler to cause it to continue to run. So all I need is the scheduler script? Or are you saying don't use the JTAC AutoLase script? Told you I was new.

Link to comment
Share on other sites

@FALT691

Pushing the task every 5 seconds like that might be problematic.

 

Better to run the scheduler every 600 seconds (10 minutes) or so.

 

Also, your mission is using an old version of Moose.lua, use this one instead

 

Also, like Majinbot said, you have conflicting triggers, as well as incorrect parameters (you have group and unit names all mixed up).

 

Finally, I wouldn't use that autolase script if I were you, it's way too complex and long for what you're trying to accomplish... and I also suspect it doesn't work with moving units.


Edited by Hardcard
Link to comment
Share on other sites

@FALT691

Pushing the task every 5 seconds like that might be problematic.

 

Better to run the scheduler every 600 seconds (10 minutes) or so.

 

 

Also, your mission is using an old version of Moose.lua, use this one instead

 

 

 

 

Thanks for the info HardCard, so to your point in the below script I should change the number 5 ( in seconds) to 600 so the scheduler runs every 10 minutes correct?

 

 

local Predator = UNIT:FindByName("drone")

 

local TestScheduler = SCHEDULER:New( nil,

function() -- t

local Coordinate = UNIT:FindByName("enemy"):GetVec2()

local DCSTask = Predator:TaskOrbitCircleAtVec2(Coordinate, 2500, 40)

Predator:PushTask(DCSTask, 1)

end, {}, 1, 5

)

Link to comment
Share on other sites

@FALT691

 

I've attached a corrected version of your mission, but, like I said, I don't think the lasing script you're using works with moving units.

 

It'll only lase static coordinates for a limited period of time...

Now, you might be thinking about increasing the "refresh rate" of the lasing coordinates... but I'm afraid that'll make laser-guided weapons lose lock and trash.

 

 

You should only be using this script with static targets, I think.

NEW_PG_REAPER_MOVING-TARGET_TEST (corrected).miz


Edited by Hardcard
Link to comment
Share on other sites

@FALT691

 

I've attached a corrected version of your mission, but, like I said, I don't think the lasing script you're using works with moving units.

 

 

 

 

Thank you sir, I appreciate the help. If you don't think this script is good would you mind pointing me to one that will work for moving vehicles?

Link to comment
Share on other sites

would you mind pointing me to one that will work for moving vehicles?

 

AFAIK, only static coordinates/units can be lased via scripting.

 

There's no way of telling a JTAC unit to keep lock on a moving target via scripting (that I know of).

 

As a workaround, the refresh rate of the lasing coordinate could be increased (to get a new coordinate every second, or so), but that would effectively "break lock"... and I'm pretty sure laser-guided bombs/missiles would simply trash.

 

Feel free to test it ;) (I haven't played with laser designation via scripting in a long time, so take what I said with a bucket of salt)


Edited by Hardcard
Link to comment
Share on other sites

AFAIK, only static coordinates/units can be lased via scripting.

 

There's no way of telling a JTAC unit to keep lock on a moving target via scripting (that I know of).

 

As a workaround, the refresh rate of the lasing coordinate could be increased (to get a new coordinate every second, or so), but that would effectively "break lock"... and I'm pretty sure laser-guided bombs/missiles would simply trash.

 

Feel free to test it ;) (I haven't played with laser designation via scripting in a long time, so take what I said with a bucket of salt)

 

 

Thanks HardCard, I appreciate the assistance, I'm running it now and the drone is following the tanks and marking them and that's all I need it to do so that I can get an idea on target location for rocket/bomb runs. So if it does what it is doing now I am good to go, so thanks again sir, salute!

Link to comment
Share on other sites

@FALT691

 

Good news, I ran some tests using a buddylasing script I wrote some time ago, looks like it is indeed possible to refresh lasing coordinates for moving targets and still hit them.

 

I've configured my buddylasing script to work with your mission and added a hornet client armed with laser mavs and gbu12s, so you can test it (mission attached).

 

Everything is managed via F10 menu, go to spectators BEFORE entering the client at mission start (press the "BACK" button and select spectators), then you can enter.

NEW_PG_REAPER_MOVING-TARGET_TEST (Universal Lasing Script Test).miz

Universal BuddyLase Script.lua


Edited by Hardcard
Link to comment
Share on other sites

  • Recently Browsing   0 members

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